Convert Method
Collapse the table of content
Expand the table of content

IValueConverter.Convert Method (Object, Type, Object, CultureInfo)


Converts a value.

Namespace:   System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

abstract Convert : 
        value:Object *
        targetType:Type *
        parameter:Object *
        culture:CultureInfo -> Object


Type: System.Object

The value produced by the binding source.

Type: System.Type

The type of the binding target property.

Type: System.Object

The converter parameter to use.

Type: System.Globalization.CultureInfo

The culture to use in the converter.

Return Value

Type: System.Object

A converted value. If the method returns null, the valid null value is used.

The data binding engine calls this method when it propagates a value from the binding source to the binding target.

The data binding engine does not catch exceptions that are thrown by a user-supplied converter. Any exception that is thrown by the Convert method, or any uncaught exceptions that are thrown by methods that the Convert method calls, are treated as run-time errors. Handle anticipated problems by returning DependencyProperty.UnsetValue.

A return value of DependencyProperty.UnsetValue indicates that the converter produced no value and that the binding uses the FallbackValue, if available, or the default value instead.

A return value of Binding.DoNothing indicates that the binding does not transfer the value or use the FallbackValue or default value.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft