How do I turn off a custom IValueConverter at design time?
Posted
by Jonathan Allen
on Stack Overflow
See other posts from Stack Overflow
or by Jonathan Allen
Published on 2010-06-15T04:17:28Z
Indexed on
2010/06/15
4:22 UTC
Read the original article
Hit count: 312
xaml
|wpf-binding
How do I turn off a custom IValueConverter at design time? Basically I want to write this:
Public Class MethodBinder
Implements IValueConverter
Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
If [DESIGN_TIME] Then Return Nothing
If value IsNot Nothing Then Return CallByName(value, CStr(parameter), CallType.Method)
Return Nothing
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotSupportedException
End Function
End Class
© Stack Overflow or respective owner