New to Telerik UI for WPFStart a free 30-day trial

Converts a file name string to a glyph character based on its file extension. Each file category (image, document, archive, etc.) maps to a configurable glyph property whose default values correspond to the built-in Telerik font icons.

Definition

Namespace:Telerik.Windows.Controls.ConversationalUI

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public class FileExtensionToGlyphConverter : IValueConverter

Inheritance: objectFileExtensionToGlyphConverter

Implements: IValueConverter

Constructors

C#
public FileExtensionToGlyphConverter()

Properties

Gets or sets the glyph returned for archive files (.zip, .rar, .7z, .tar, .gz, .bz2). The default value is the GlyphZip character ().

C#
public string ArchiveGlyph { get; set; }

Gets or sets the glyph returned for audio files (.mp3, .wav, .flac, .ogg, .aac, .wma, .m4a). The default value is the GlyphFileAudio character ().

C#
public string AudioGlyph { get; set; }

Gets or sets the glyph returned for programming and code files (.cs, .js, .ts, .py, .java, .cpp, .c, .h, .rb, .go, .rs, .swift, .kt, .php, .lua, .r, .sh, .bat, .ps1). The default value is the GlyphFileProgramming character ().

C#
public string CodeGlyph { get; set; }

Gets or sets the glyph returned for CSV files (.csv). The default value is the GlyphCsv character ().

C#
public string CsvGlyph { get; set; }

Gets or sets the glyph returned for data files (.json, .xml, .sql, .yaml, .yml, .toml, .ini, .config). The default value is the GlyphFileData character ().

C#
public string DataGlyph { get; set; }

Gets or sets the default glyph returned when the file extension does not match any known category. The default value is the GlyphFile character ().

C#
public string DefaultGlyph { get; set; }

Gets or sets the glyph returned for image file extensions (.png, .jpg, .jpeg, .gif, .bmp, .svg, .webp, .ico, .tiff, .tif). The default value is the GlyphFileImage character ().

C#
public string ImageGlyph { get; set; }

Gets or sets the glyph returned for PDF files (.pdf). The default value is the GlyphPdf character ().

C#
public string PdfGlyph { get; set; }

Gets or sets the glyph returned for presentation files (.ppt, .pptx, .odp). The default value is the GlyphFilePresentation character ().

C#
public string PresentationGlyph { get; set; }

Gets or sets the glyph returned for spreadsheet files (.xls, .xlsx, .ods). The default value is the GlyphExcel character ().

C#
public string SpreadsheetGlyph { get; set; }

Gets or sets the glyph returned for plain text files (.txt, .log, .md). The default value is the GlyphTxt character ().

C#
public string TextGlyph { get; set; }

Gets or sets the glyph returned for video files (.mp4, .avi, .mov, .mkv, .wmv, .flv, .webm). The default value is the GlyphFileVideo character ().

C#
public string VideoGlyph { get; set; }

Gets or sets the glyph returned for word-processor document files (.doc, .docx, .rtf, .odt). The default value is the GlyphWord character ().

C#
public string WordGlyph { get; set; }

Methods

Converts a file name to a glyph character based on its file extension.

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

The file name string.

targetTypeType

The type of the binding target property.

parameterobject

The converter parameter (not used).

cultureCultureInfo

The culture to use in the converter.

Returns:

object

A single-character glyph string matching the file extension category, or DefaultGlyph if no match is found.

Not supported. Throws NotSupportedException.

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

The value that is produced by the binding target.

targetTypeType

The type to convert to.

parameterobject

The converter parameter to use.

cultureCultureInfo

The culture to use in the converter.

Returns:

object

Nothing. This method always throws.