ClassChatFileExtensionToImageSourceConverter
A value converter that maps file extensions to corresponding image sources. This converter uses a dictionary of file extension and image source pairs to perform the mapping.
Definition
Namespace:Telerik.Maui.Controls.Chat
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class ChatFileExtensionToImageSourceConverter : IValueConverter
Inheritance: objectChatFileExtensionToImageSourceConverter
Implements:
Constructors
ChatFileExtensionToImageSourceConverter()
Declaration
public ChatFileExtensionToImageSourceConverter()
Properties
Dictionary
Gets the collection of dictionary items used for value conversion. Each item in the dictionary represents a mapping between a file extension and an image source.
Declaration
public List<ChatFileExtensionToImageSourceConverterItem> Dictionary { get; }
Property Value
FallbackValue
Gets or sets the fallback value to use when no matching dictionary item is found. If no match is found and the fallback value is not set, the original value is returned.
Methods
Convert(object, Type, object, CultureInfo)
Converts a file extension to an image source by looking it up in the dictionary.
Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
The file extension value to convert (used as the lookup key).
targetType
The type to convert to. This parameter is not used.
parameter
An optional parameter. This parameter is not used.
culture
The culture to use for conversion. This parameter is not used.
Returns
The corresponding ImageSource value from the dictionary if found; otherwise, the fallback value or the original value.
ConvertBack(object, Type, object, CultureInfo)
Converts an image source back to a file extension. This operation is not supported and will throw a NotSupportedException.
Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
value
The value to convert back. This parameter is not used.
targetType
The type to convert to. This parameter is not used.
parameter
An optional parameter. This parameter is not used.
culture
The culture to use for conversion. This parameter is not used.
Returns
Throws a NotSupportedException.
Exceptions
Always thrown because backward conversion is not supported.