Posts

Showing posts from April, 2017

WPF Bind a combobox to an enumeration

I've often found myself needing to bind a combo box to an enumeration I've created. You can do this in WPF but it's a bit complicated. You end up needing to create a static resource. I had mine in a user control. First the enumeration I was using: namespace XmlCoderBI.Enums { /// <summary> /// An enumeration that represents the type of conversion we're doing /// </summary> public enum ConversionType { /// <summary> /// The binary /// </summary> [Description( "Binary" )] Binary = 0, /// <summary> /// The base64 /// </summary> [Description( "Binary" )] Base64 = 1, /// <summary> /// The hexadecimal /// </summary> [Description( "Hexadecimal" )] Hexadecimal = 2, /// <summary> /// The UTF-8 /// </summary> [Description( ...