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

Provides a base class for label formatters that convert typed values to string representations. This abstract class implements ILabelFormatter to provide type-safe label formatting functionality.

Definition

Namespace:Telerik.Maui.Controls.Compatibility.Chart

Assembly:Telerik.Maui.Controls.Compatibility.dll

Type Parameters:

T

The type of values that this formatter can handle.

Syntax:

C#
public abstract class LabelFormatterBase<T> : ILabelFormatter

Inheritance: objectLabelFormatterBase<T>

Implements: ILabelFormatter

Constructors

C#
protected LabelFormatterBase()

Properties

Gets the conversion context for the formatter.

C#
public virtual object ConvertionContext { get; }
Property Value:

The conversion context object, or null if no context is available.

Implements: ILabelFormatter.ConvertionContext

Gets the type of values that this formatter handles.

C#
public Type ValueType { get; }
Property Value:

The Type representing the value type T.

Implements: ILabelFormatter.ValueType

Methods

Formats a typed value into a string representation.

C#
public abstract string FormatTypedValue(T value)
Parameters:valueT

The value of type T to format.

Returns:

string

A string representation of the formatted value.

Formats an object value into a string representation. This method casts the object to type T and calls FormatTypedValue(T).

C#
public string FormatValue(object value)
Parameters:valueobject

The value to format, which will be cast to type T.

Returns:

string

A string representation of the formatted value.

Implements: ILabelFormatter.FormatValue(object)