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
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 ().
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 ().
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 ().
public string CodeGlyph { get; set; }
Gets or sets the glyph returned for CSV files (.csv). The default value is the GlyphCsv character ().
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 ().
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 ().
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 ().
public string ImageGlyph { get; set; }
Gets or sets the glyph returned for PDF files (.pdf). The default value is the GlyphPdf character ().
public string PdfGlyph { get; set; }
Gets or sets the glyph returned for presentation files (.ppt, .pptx, .odp). The default value is the GlyphFilePresentation character ().
public string PresentationGlyph { get; set; }
Gets or sets the glyph returned for spreadsheet files (.xls, .xlsx, .ods). The default value is the GlyphExcel character ().
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 ().
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 ().
public string VideoGlyph { get; set; }
Methods
Converts a file name to a glyph character based on its file extension.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
The file name string.
targetTypeTypeThe type of the binding target property.
parameterobjectThe converter parameter (not used).
cultureCultureInfoThe culture to use in the converter.
Returns:A single-character glyph string matching the file extension category, or DefaultGlyph if no match is found.
Not supported. Throws NotSupportedException.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
The value that is produced by the binding target.
targetTypeTypeThe type to convert to.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns:Nothing. This method always throws.