I have an Enum that I want to databind to a wpf drop down box. But I want to represent the enum with some nice descriptions instead of Enum.ToString().
1) The enum with the nice descriptions: MyEnum.cs
public enum MyEnum
{
[Description("Default value")] // Default value if enum is nullable and used in databinding
DefaultValue,
[Description("Value1 description")]
Value1,
[Description("Value2 description")]
Value2
}
(more…)