Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Converter Property

Binding.Converter Property

Gets or sets the converter to use.

Namespace:  System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public IValueConverter Converter { get; set; }
<object Converter="myConverter"/>

XAML Values

myConverter

A resource reference to a class that implements the IValueConverter interface, which includes implementations of the Convert and ConvertBack methods. To refer to a value converter, use the StaticResource Markup Extension.

Property Value

Type: System.Windows.Data.IValueConverter
A value of type IValueConverter. The default is null.

A binding implicitly uses a default converter that tries to do a type conversion between the source value and the target value. If a conversion cannot be made, the default converter returns null.

If you want to associate a custom value converter with a binding, you should create a class that implements the IValueConverter interface and supply implementations for the Convert and ConvertBack methods. Value converters can change data from one type to another, translate between cultural details such as character sets, or modify other aspects of their presentation. For examples of typical conversion scenarios, see "Data Conversion" in the Data Binding Overview.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft