How to bind an enum to a combobox control in WPF?

I am trying to find a simple example where the enums are shown as is. All examples I have seen tries to add nice looking display strings but I don’t want that complexity.

Basically I have a class that holds all the properties that I bind, by first setting the DataContext to this class, and then specifying the binding like this in the xaml file:

<ComboBox ItemsSource="{Binding Path=EffectStyle}"/>

But this doesn’t show the enum values in the ComboBox as items.

20 Answers
20

Leave a Comment