Represents a value converter that returns the value if it is non-null; otherwise, the value of the converter's parameter.
- Inheritance:
- object object
Remarks
This converter can also be used with Multi
Constructors
CoalesceConverter()
Initializes an instance of the class.
Methods
Convert(object, Type, object, CultureInfo)
Converts a value. The data binding engine calls this method when it propagates a value from the binding source to the binding target.
Parameter | Type | Description |
---|---|---|
value | object | The value produced by the binding source. |
targetType | Type | The type of the binding target property. |
parameter | object | The converter parameter to use. |
culture | Culture |
The culture to use in the converter. |
Returns
- object:
A converted value.
Convert(object[], Type, object, CultureInfo)
Converts source values to a value for the binding target. The data binding engine calls this method when it propagates the values from source bindings to the binding target.
Parameter | Type | Description |
---|---|---|
values | object[] | The array of values that the source bindings in the Multi |
targetType | Type | The type of the binding target property. |
parameter | object | The converter parameter to use. |
culture | Culture |
The culture to use in the converter. |
Returns
- object:
The first non-null value from
values
, otherwiseparameter
is returned.
ConvertBack(object, Type, object, CultureInfo)
Converts a value. The data binding engine calls this method when it propagates a value from the binding target to the binding source.
Parameter | Type | Description |
---|---|---|
value | object | The value produced by the binding source. |
targetType | Type | The type of the binding target property. |
parameter | object | The converter parameter to use. |
culture | Culture |
The culture to use in the converter. |
Returns
- object:
A converted value.
ConvertBack(object, Type[], object, CultureInfo)
Converts a binding target value to the source binding values.
Parameter | Type | Description |
---|---|---|
value | object | The value that the binding target produces. |
targetTypes | Type[] | The array of types to convert to. The array length indicates the number and types of values that are suggested for the method to return. |
parameter | object | The converter parameter to use. |
culture | Culture |
The culture to use in the converter. |
Returns
- object[]:
An array of values that have been converted from the target value back to the source values.