Converter for mapping from one set of arbitrary values to another set of values, using Object.Equals.
Note that this map will only convert from keys to values. Converting back is not supported because it would involve searching through the values in the map. Searching would be O(n), and may not be predictable because the ordering may not be consistent across map instances.
Public Member Functions |
|
MappingConverter () | |
Default constructor. |
|
MappingConverter (IDictionary map) | |
Construct with Map. |
|
override object | ProvideValue (IServiceProvider serviceProvider) |
Supports MarkupExtension by returning the
current instance. |
|
object | Convert (object value, Type targetType, object parameter, CultureInfo culture) |
Convert from a key in the map to its
corresponding value. |
|
Properties |
|
IDictionary |
Map [get, set] |
Map of keys to values. |
WPFCustomControls::Converters::MappingConverter::MappingConverter | ( | ) | [inline] |
Default constructor.
WPFCustomControls::Converters::MappingConverter::MappingConverter | ( | IDictionary | map | ) | [inline] |
Construct with Map.
map | IDictionary providing the mapping from keys to values. |
override object WPFCustomControls::Converters::MappingConverter::ProvideValue | ( | IServiceProvider | serviceProvider | ) | [inline] |
Supports MarkupExtension by returning the current instance.
serviceProvider | Ingored. |
object WPFCustomControls::Converters::MappingConverter::Convert | ( | object | value, |
Type | targetType, | ||
object | parameter, | ||
CultureInfo | culture | ||
) | [inline] |
Convert from a key in the map to its corresponding value.
value | Value to find as a key in the Map. |
targetType | Ignored |
parameter | Ignored |
culture | Ignored |
IDictionary
WPFCustomControls::Converters::MappingConverter::Map [get,
set] |
Map of keys to values.