WPFCustomControls::Converters::EnumConverter Class Reference


Detailed Description

Converts from Enum values to human-readable localizable Strings.

The human-readable strings can be set directly, or can be inferred from a ReferenceDictionary.

AvailableValues ReferenceDictionary

List of all members.

Public Member Functions

object  Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  Converts from an Enum value to a corresponding human-readable string version of the enum drawn from AvailableValues.
object  ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  Converts from a human-readable string drawn from AvailableValues to a corresponding Enum value.

Properties

Type  EnumType [get, set]
  The Enum type to perform conversions on.
ResourceDictionary  ReferenceDictionary [get, set]
  A Dictionary that contains the comma-seperated string definition of the enum human-readable values to use.
String[]  AvailableValues [get, set]
  Contains the array of human-readable values.

Member Function Documentation

object WPFCustomControls::Converters::EnumConverter::Convert ( object  value,
Type  targetType,
object  parameter,
System.Globalization.CultureInfo  culture 
) [inline]

Converts from an Enum value to a corresponding human-readable string version of the enum drawn from AvailableValues.

Parameters:
value The enum value.
targetType The target type is String.
parameter not used
culture not used
Returns:
The converted value.
object WPFCustomControls::Converters::EnumConverter::ConvertBack ( object  value,
Type  targetType,
object  parameter,
System.Globalization.CultureInfo  culture 
) [inline]

Converts from a human-readable string drawn from AvailableValues to a corresponding Enum value.

Parameters:
value The human-readable string value.
targetType The target Enum type.
parameter not used
culture not used
Returns:
The converted value.

Property Documentation

Type WPFCustomControls::Converters::EnumConverter::EnumType [get, set]

The Enum type to perform conversions on.

ResourceDictionary WPFCustomControls::Converters::EnumConverter::ReferenceDictionary [get, set]

A Dictionary that contains the comma-seperated string definition of the enum human-readable values to use.

These strings should also be localized.

This value can either be set directly, or it can be inferred by setting the ReferenceDictionary on the converter. The converter will attempt to look for value with a key equal to the Full class name of the Enum type being converted. If the AvailableValues array cannot be constructed, then the converter will throw an exception.

String [] WPFCustomControls::Converters::EnumConverter::AvailableValues [get, set]

Contains the array of human-readable values.

This value can either be set directly, or it can be inferred by setting the ReferenceDictionary on the converter. The converter will attempt to look for value with a key equal to the Full class name of the Enum type being converted. If the AvailableValues array cannot be constructed, then the converter will throw an exception.


WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter
WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter WPFCustomControls::Converters::EnumConverter