Two function should be implemented, and I am wondering what type of validation I need to do on inputs and how to manage errors.
Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
End Function
I need to check if the type of value and the type of parameter are what I am expecting.
In case they are not, should I return nothing and catch the wrong behavior in another place? Or should I throw here an exception or an assert?
Is there any best or suggested practices to apply here?