New to Telerik UI for .NET MAUIStart a free 30-day trial

A converter that executes an arithmetic operation with the value and one operand.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public class ArithmeticConverter : IValueConverter

Inheritance: objectArithmeticConverter

Implements: IValueConverter

Constructors

C#
public ArithmeticConverter()

Fields

Gets a pre-configured converter that subtracts 1 from the input value.

C#
public static readonly ArithmeticConverter Minus1Converter

Gets a pre-configured converter that adds 1 to the input value.

C#
public static readonly ArithmeticConverter Plus1Converter

Properties

Gets or sets the first (left) operand.

C#
public double? FirstOperand { get; set; }

Gets or sets the arithmetic operator. For example '+', '-', '*', '/', '%'.

C#
public string Operator { get; set; }

Gets or sets the second (right) operand.

C#
public double? SecondOperand { get; set; }

Methods

Converts a value by applying the configured arithmetic operation.

C#
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters:valueobject

The value to convert.

targetTypeType

The type of the target property.

parameterobject

The converter parameter to use.

cultureCultureInfo

The culture to use in the converter.

Returns:

object

The converted value.

Converts a value back by applying the reverse of the configured arithmetic operation.

C#
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters:valueobject

The value to convert back.

targetTypeType

The type of the target property.

parameterobject

The converter parameter to use.

cultureCultureInfo

The culture to use in the converter.

Returns:

object

The converted value.