Method Convert
Convert(object[], Type, object, CultureInfo)
Convert a value. Called when moving values from sources to target.
object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
Parameters
values
object[]Array of values, as produced by source bindings. System.Windows.DependencyProperty.UnsetValue may be passed to indicate that the source binding has no value to provide for conversion.
targetType
Typetarget type
parameter
objectconverter parameter
culture
CultureInfoculture information
Returns
- object
Converted value.
System.Windows.DependencyProperty.UnsetValue may be returned to indicate that the converter produced no value and that the fallback (if available) or default value should be used instead.
Binding.DoNothing may be returned to indicate that the binding should not transfer the value or use the fallback or default value.
Remarks
The data binding engine does not catch exceptions thrown by a user-supplied converter. Thus any exception thrown by Convert, or thrown by methods it calls and not caught by the Convert, will be treated as a runtime error (i.e. a crash). Convert should handle anticipated problems by returning DependencyProperty.UnsetValue.