Class
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:

cs-api-definition
public class ArithmeticConverter : IValueConverter

Inheritance: objectArithmeticConverter

Implements: IValueConverter

Constructors

ArithmeticConverter()

Declaration

cs-api-definition
public ArithmeticConverter()

Fields

Minus1Converter

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

Declaration

cs-api-definition
public static readonly ArithmeticConverter Minus1Converter

Field Value

ArithmeticConverter

Plus1Converter

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

Declaration

cs-api-definition
public static readonly ArithmeticConverter Plus1Converter

Field Value

ArithmeticConverter

Properties

FirstOperand

Gets or sets the first (left) operand.

Declaration

cs-api-definition
public double? FirstOperand { get; set; }

Property Value

double?

Operator

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

Declaration

cs-api-definition
public string Operator { get; set; }

Property Value

string

SecondOperand

Gets or sets the second (right) operand.

Declaration

cs-api-definition
public double? SecondOperand { get; set; }

Property Value

double?

Methods

Convert(object, Type, object, CultureInfo)

Converts a value by applying the configured arithmetic operation.

Declaration

cs-api-definition
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The value to convert.

targetType

Type

The type of the target property.

parameter

object

The converter parameter to use.

culture

CultureInfo

The culture to use in the converter.

Returns

object

The converted value.

ConvertBack(object, Type, object, CultureInfo)

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

Declaration

cs-api-definition
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The value to convert back.

targetType

Type

The type of the target property.

parameter

object

The converter parameter to use.

culture

CultureInfo

The culture to use in the converter.

Returns

object

The converted value.