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

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:

C#
public class CountToListConverter : IValueConverter

Inheritance: objectCountToListConverter

Implements: IValueConverter

Constructors

C#
public CountToListConverter()

Properties

Instance

IValueConverter

Gets the singleton instance of the CountToListConverter.

C#
public static IValueConverter Instance { get; }
Property Value:

The singleton instance of the converter.

Methods

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

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

The count value to convert.

targetTypeType

The type to convert to.

parameterobject

Additional parameter for the conversion.

cultureCultureInfo

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.

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

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

The value to convert back.

targetTypeType

The type to convert back to.

parameterobject

Additional parameter for the conversion.

cultureCultureInfo

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.