Hi All,
This might be something very straight forward and I really think it should work as is, but it doesn't... I have the following scenario:
var itemSource = new Binding
{
Path = new PropertyPath("ItemList"),
Mode = BindingMode.OneTime
};
comboBox.SetBinding(ItemsControl.ItemsSourceProperty, itemSource);
ItemList is simply:
public IList<string> ItemList
{
get
{
return Enum.GetNames(typeof(OptionsEnum)).ToList();
}
}
I would have expected this to bind the list of items to the Combobox, and when I do it in XAML it works fine, but I have to do it in code behind...
Any ideas?