I am trying to draw few entities in WPF. My collection contains System.Drawing.Rectangle objects, When I try to access the location of those objects in WPF XAML I am getting following error
Cannot create default converter to perform 'one-way' conversions between types 'System.Drawing.Point' and 'System.Windows.Point'. Consider using Converter property of Binding
I know I have to use some valueconverter. Could you please guide me how to convert System.Drawing.Point' to'System.Windows.Point?
Update:
Following code gives some exception
public class PointConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
System.Windows.Point pt = (Point)(value);
return pt;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
XAML:
<PathFigure StartPoint= "{Binding BoundingRect.Location, Converter={StaticResource PointConverter}}">