แก้ไข

แชร์ผ่าน


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

Definition

Converts a value.

public:
 System::Object ^ ConvertBack(System::Object ^ value, Type ^ targetType, System::Object ^ parameter, System::Globalization::CultureInfo ^ culture);
public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture);
abstract member ConvertBack : obj * Type * obj * System.Globalization.CultureInfo -> obj
Public Function ConvertBack (value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object

Parameters

value
Object

The value that is produced by the binding target.

targetType
Type

The type to convert to.

parameter
Object

The converter parameter to use.

culture
CultureInfo

The culture to use in the converter.

Returns

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

Remarks

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

The implementation of this method must be the inverse of the Convert method.

The data binding engine does not catch exceptions that are thrown by a user-supplied converter. Any exception that is thrown by the ConvertBack method, or any uncaught exceptions that are thrown by methods that the ConvertBack 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.

Applies to