Class
FileSizeConverter

Converts a file size in bytes (long) to a human-readable string (e.g. "1.5 MB").

Definition

Namespace:Telerik.Windows.Controls.ConversationalUI

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public class FileSizeConverter : IValueConverter

Inheritance: objectFileSizeConverter

Implements: IValueConverter

Constructors

FileSizeConverter()

Declaration

cs-api-definition
public FileSizeConverter()

Methods

Convert(object, Type, object, CultureInfo)

Converts a numeric byte count to a formatted file size string.

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 type of the binding target property.

parameter

object

The converter parameter (not used).

culture

CultureInfo

The culture to use in the converter.

Returns

object

A human-readable file size string such as "512 B", "1.5 KB", "3.2 MB", or "1.1 GB".

ConvertBack(object, Type, object, CultureInfo)

Not supported. Throws NotSupportedException.

Declaration

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

Parameters

value

object

targetType

Type

parameter

object

culture

CultureInfo

Returns

object