I need to display all enum values as tab items on TabControl, except one enum member (None)
enum MyEnum { Value1, Value2, Value3, None }
TabControl should display three tabs (Value1, Value2 and Value3). I need to be able to get/set current tab in the ViewModel by binding to SelectedItem property. Header for each tab uses localized enum value, which currently I do using converter.
Is this possible? I have tried many things, but could not make it work. I have no trouble with manually adding each TabItem, but I am unsure how to make SelectedItem (tab) to be of enum type.
I found the solution. Normally you would do this in order to get a list of enum members:
This would get all the members, so its not a way to go. I have created a custom converter that will accept enum value, and extract all members from type
Localization is done in the ItemTemplate. In there I also use converter (different one), where I get the localized value.