Daniel's XL Toolbox NG
|
Facilitates WPF data binding to enums by providing an enumeration of Choices, read/write access to a string representation (which may be localized in derived classes), and the type-safe enum value itself. More...
Facilitates WPF data binding to enums by providing an enumeration of Choices, read/write access to a string representation (which may be localized in derived classes), and the type-safe enum value itself.
When providing a public EnumProvider property, you need to wire up the PropertyChanged event:
To bind to a ComboBox to an EnumProvider property, use:
To make use of per-item enabled states and tool tips, it is helpful to define a generic style in a central resource dictionary:
Since generic type parameters cannot be enums, the workaround "struct, IConvertible" is used here as suggested in http://stackoverflow.com/q/79126/270712
T | : | struct | |
T | : | IConvertible |