ClassFileExtensionToGlyphConverter
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:
public class FileExtensionToGlyphConverter : IValueConverter
Inheritance: objectFileExtensionToGlyphConverter
Implements:
Constructors
FileExtensionToGlyphConverter()
Declaration
public FileExtensionToGlyphConverter()
Properties
ArchiveGlyph
Gets or sets the glyph returned for archive files (.zip, .rar, .7z, .tar, .gz, .bz2). The default value is the GlyphZip character ().
AudioGlyph
Gets or sets the glyph returned for audio files (.mp3, .wav, .flac, .ogg, .aac, .wma, .m4a). The default value is the GlyphFileAudio character ().
CodeGlyph
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 ().
CsvGlyph
Gets or sets the glyph returned for CSV files (.csv). The default value is the GlyphCsv character ().
DataGlyph
Gets or sets the glyph returned for data files (.json, .xml, .sql, .yaml, .yml, .toml, .ini, .config). The default value is the GlyphFileData character ().
DefaultGlyph
Gets or sets the default glyph returned when the file extension does not match any known category. The default value is the GlyphFile character ().
ImageGlyph
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 ().
PdfGlyph
Gets or sets the glyph returned for PDF files (.pdf). The default value is the GlyphPdf character ().
PresentationGlyph
Gets or sets the glyph returned for presentation files (.ppt, .pptx, .odp). The default value is the GlyphFilePresentation character ().
SpreadsheetGlyph
Gets or sets the glyph returned for spreadsheet files (.xls, .xlsx, .ods). The default value is the GlyphExcel character ().
TextGlyph
Gets or sets the glyph returned for plain text files (.txt, .log, .md). The default value is the GlyphTxt character ().
VideoGlyph
Gets or sets the glyph returned for video files (.mp4, .avi, .mov, .mkv, .wmv, .flv, .webm). The default value is the GlyphFileVideo character ().
Methods
Convert(object, Type, object, CultureInfo)
Converts a file name to a glyph character based on its file extension.
Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
The file name string.
targetType
The type of the binding target property.
parameter
The converter parameter (not used).
culture
The culture to use in the converter.
Returns
A single-character glyph string matching the file extension category, or DefaultGlyph if no match is found.
ConvertBack(object, Type, object, CultureInfo)
Not supported. Throws NotSupportedException.
Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
The value that is produced by the binding target.
targetType
The type to convert to.
parameter
The converter parameter to use.
culture
The culture to use in the converter.
Returns
Nothing. This method always throws.