I have a combobox in which I want to use the items of an enumeration as items source. However, I can't use directly the enumeration as item source, so I use a obeservable collection in this way:
public class MyViewModel
{
public MyViewModel()
{
MyItemsSoruce = new ObservableCollection<MyEnum>();
foreach(MyEnum iterator Enum.GetValues(typeof(MyEnum)))
{
MyItemsSource.Add(iterator);
}
}
}
This works, but the problem is that I don't have a null or black item at first position, so I can deselect the items of the combobox.
I have tried to add a null item first and later populate the collection with the foreach, it works, but the problem is that the first item of the combobox it is very small, the height is almost 0, so it is very hard to select it.
How could add a null item in the collection and show with the same height than the rest of items?
Thanks.