New to Telerik UI for .NET MAUIStart a free 30-day trial

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.PromptInput

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public class PromptInputFileExtensionToImageSourceConverter : IValueConverter

Inheritance: objectPromptInputFileExtensionToImageSourceConverter

Implements: IValueConverter

Constructors

C#
public PromptInputFileExtensionToImageSourceConverter()

Properties

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.

C#
public List<PromptInputFileExtensionToImageSourceConverterItem> Dictionary { get; }

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.

C#
public object FallbackValue { get; set; }

Methods

Converts a file extension to an image source by looking it up in the dictionary.

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

The file extension value to convert (used as the lookup key).

targetTypeType

The type to convert to. This parameter is not used.

parameterobject

An optional parameter. This parameter is not used.

cultureCultureInfo

The culture to use for conversion. This parameter is not used.

Returns:

object

The corresponding ImageSource value from the dictionary if found; otherwise, the fallback value or the original value.

Converts an image source back to a file extension. This operation is not supported and will throw a NotSupportedException.

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

The value to convert back. This parameter is not used.

targetTypeType

The type to convert to. This parameter is not used.

parameterobject

An optional parameter. This parameter is not used.

cultureCultureInfo

The culture to use for conversion. This parameter is not used.

Returns:

object

Throws a NotSupportedException.

Exceptions:

NotSupportedException

Always thrown because backward conversion is not supported.