ArithmeticConverter
A converter that executes an arithmetic operation with the value and one operand.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class ArithmeticConverter : IValueConverter
Inheritance: objectArithmeticConverter
Implements:
Constructors
public ArithmeticConverter()
Fields
Gets a pre-configured converter that subtracts 1 from the input value.
public static readonly ArithmeticConverter Minus1Converter
Gets a pre-configured converter that adds 1 to the input value.
public static readonly ArithmeticConverter Plus1Converter
Properties
Gets or sets the first (left) operand.
public double? FirstOperand { get; set; }
Gets or sets the arithmetic operator. For example '+', '-', '*', '/', '%'.
public string Operator { get; set; }
Gets or sets the second (right) operand.
public double? SecondOperand { get; set; }
Methods
Converts a value by applying the configured arithmetic operation.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
The value to convert.
targetTypeTypeThe type of the target property.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns:The converted value.
Converts a value back by applying the reverse of the configured arithmetic operation.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
The value to convert back.
targetTypeTypeThe type of the target property.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns:The converted value.