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:
public class HumanReadableFileSizeConverter : IValueConverter
Inheritance: objectHumanReadableFileSizeConverter
Implements:
Constructors
public HumanReadableFileSizeConverter()
Properties
Gets a static instance of the HumanReadableFileSizeConverter.
public static HumanReadableFileSizeConverter Instance { get; }
Methods
Converts a number, representing a file size in bytes, to a human-readable string using the specified format.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
The file size in bytes.
targetTypeTypeThe target type (not used).
parameterobjectThe format string (optional, defaults to "{0:0.#} {1}").
cultureCultureInfoThe culture information (not used).
Returns:A human-readable string representing the file size.
Not implemented. Throws NotImplementedException.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
The value to convert back.
targetTypeTypeThe target type.
parameterobjectThe converter parameter.
cultureCultureInfoThe culture information.
Returns:Throws NotImplementedException.
Exceptions:Always thrown.