Method ConvertBack
ConvertBack(object, Type, object, CultureInfo)
Convert back a value. Called when moving a value from target to source. This should implement the inverse of Convert.
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
objectvalue, as produced by target
targetType
Typetarget type
parameter
objectconverter parameter
culture
CultureInfoculture information
Returns
- object
Converted back value.
Binding.DoNothing may be returned to indicate that no value should be set on the source property.
System.Windows.DependencyProperty.UnsetValue may be returned to indicate that the converter is unable to provide a value for the source property, and no value will be set to it.
Remarks
The data binding engine does not catch exceptions thrown by a user-supplied converter. Thus any exception thrown by ConvertBack, or thrown by methods it calls and not caught by the ConvertBack, will be treated as a runtime error (i.e. a crash). ConvertBack should handle anticipated problems by returning DependencyProperty.UnsetValue.