Class
HumanReadableFileSizeConverter

Converts a number, representing a file size in bytes, to a human-readable string representation (e.g., KB, MB, GB).

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class HumanReadableFileSizeConverter : IValueConverter

Inheritance: objectHumanReadableFileSizeConverter

Implements: IValueConverter

Constructors

HumanReadableFileSizeConverter()

Declaration

cs-api-definition
public HumanReadableFileSizeConverter()

Properties

Instance

Gets a static instance of the HumanReadableFileSizeConverter.

Declaration

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

Property Value

HumanReadableFileSizeConverter

Methods

Convert(object, Type, object, CultureInfo)

Converts a number, representing a file size in bytes, to a human-readable string using the specified format.

Declaration

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

Parameters

value

object

The file size in bytes.

targetType

Type

The target type (not used).

parameter

object

The format string (optional, defaults to "{0:0.#} {1}").

culture

CultureInfo

The culture information (not used).

Returns

object

A human-readable string representing the file size.

ConvertBack(object, Type, object, CultureInfo)

Not implemented. Throws NotImplementedException.

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 target type.

parameter

object

The converter parameter.

culture

CultureInfo

The culture information.

Returns

object

Throws NotImplementedException.

Exceptions

NotImplementedException

Always thrown.