Class
CountToListConverter

A converter that converts a number (for example 7) to a list of numbers (1, 2, 3, 4, 5, 6, 7).

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class CountToListConverter : IValueConverter

Inheritance: objectCountToListConverter

Implements: IValueConverter

Constructors

CountToListConverter()

Declaration

cs-api-definition
public CountToListConverter()

Properties

Instance

Gets the singleton instance of the CountToListConverter.

Declaration

cs-api-definition
public static IValueConverter Instance { get; }

Property Value

IValueConverter

The singleton instance of the converter.

Methods

Convert(object, Type, object, CultureInfo)

Converts a count value to a list of sequential numbers starting from 1.

Declaration

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

Parameters

value

object

The count value to convert.

targetType

Type

The type to convert to.

parameter

object

Additional parameter for the conversion.

culture

CultureInfo

The culture to use for the conversion.

Returns

object

A list of integers from 1 to the specified count, or null if the value is invalid.

ConvertBack(object, Type, object, CultureInfo)

Converts back from a list to a count value. This operation is not supported.

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 to convert back to.

parameter

object

Additional parameter for the conversion.

culture

CultureInfo

The culture to use for the conversion.

Returns

object

Not supported - throws NotSupportedException.

Exceptions

NotSupportedException

Thrown when this method is called as it's not supported.