My WPF application has an extension which I found in answer to a question on StackOverflow which creates choices for a ComboBox
from an enumeration. I don't remember which post I got it from, but as this isn't the problem, it's irrelevant.
I'm using a DLL for our product's backend in my WPF application. There is an enumeration in this DLL that I want the user to pick from using a ComboBox
and the afore mentioned extension. I have the proper xmlns defined in the XAML.
The problem is that my enumeration is a subclass of another class. That is, it's defined something like this:
public class MyClass {
. . .
public enum MyEnum { . . . }
. . .
}
I thought that the XAML for the ComboBox
should look something like this:
<ComboBox ItemsSource="{Binding Source={cs:Enumeration {x:Type ns:MyClass.MyEnum}}}"
. . . />
As I type "MyClass", when I type the period to separate the parent class name from the subtype's name, Intellisense just provides the upper level class names again. If I just type the subclass name after the period anyway, the compiler gives me an error: "Type MyClass.MyEnum not found".
How do I correctly specify the name of my enumeration?