MultiplicationConverter Class
Represents a single and multi-value converter that multiplies all the source values provided, and optionally the converter's parameter.
public class MultiplicationConverter
- Inheritance:
- object object
Remarks
This converter expects the following source values to be either a double or an int.
Examples
<MultiBinding Converter="{StaticResource MultiplicationConverter}">
<Binding Path="Value1" />
<Binding Path="Value2" />
</MultiBinding>
Constructors
MultiplicationConverter()
Initializes an instance of the class.
public MultiplicationConverter()
Methods
Convert(object, Type, object, CultureInfo)
Converts a value.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
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 | CultureInfo | The culture to use in the converter. |
Returns
- object:
A converted value. If the method returns null, the valid null value is used.
Convert(object[], Type, object, CultureInfo)
Returns the product of all the source values.
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
values | object[] | The array of values that the source bindings in the MultiBinding produces. |
targetType | Type | The type of the binding target property. |
parameter | object | The converter parameter to use. |
culture | CultureInfo | The culture to use in the converter. |
Returns
- object:
The product of all the source values.
ConvertBack(object, Type, object, CultureInfo)
Converts a value.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
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
- object:
A converted value. If the method returns null, the valid null value is used.
ConvertBack(object, Type[], object, CultureInfo)
Converts a binding target value to the source binding values.
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
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 | CultureInfo | 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.