IValueConverter

References
public interface IValueConverter
Interface for providing a reusable converter for binding values

Methods

Convert

#
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Converts the value to the specified targetType
Remarks: This is called when translating the value from the source to the destination, usually from the Control to the View Model.
value (object)Value to convert
targetType (Type)Type to convert the value to
parameter (object)Context-specific parameter passed from the binding
culture (CultureInfo)Culture to convert with
A converted value with the type of targetType.

ConvertBack

#
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Converts the value to the specified targetType.
Remarks: This is called when translating the value back from the destination to the source, usually from the View Model to the Control. This should be the reverse implementation of the Convert(object, Type, object, CultureInfo) method.
value (object)Value to convert
targetType (Type)Type to convert the value back to
parameter (object)Context-specific parameter passed from the binding
culture (CultureInfo)Culture to convert with
A converted value with the type of targetType.