Public Class MyPointConverter
Implements IValueConverter
' Convert gets called to convert value to text.
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
Dim editor As ValueEditor = DirectCast(parameter, ValueEditor)
If TypeOf value Is Point AndAlso targetType Is GetType(String) Then
value.ToString()
End If
Return Infragistics.Windows.Utilities.ConvertDataValue(value, targetType, editor.FormatProvider, editor.Format)
End Function
' ConvertBack gets called to convert user input into to value.
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
Dim text As String = String.Empty
If Not Nothing Is value Then
text = value.ToString()
End If
Return Point.Parse(text)
End Function
End Class