D
dave
i have a wpf form with a combo box. i want to set the itemssource from a
List<String> property in the class for the form. it works properly if i set
it from the constructor after the InitializeComponent() call like this:
cb.ItemsSource = mylist;
But i have tried all sorts of combinations to set it from the xaml. I think
i am being fought by the datacontext set for the top level form which points
at an XElement. The datacontext is needed to set the combobox text property
which is bound to an element in the xml.
do i somehow have to set a different datacontext for the combobox items??
or is there some other context to bind it to the class property that i am
missing??
List<String> property in the class for the form. it works properly if i set
it from the constructor after the InitializeComponent() call like this:
cb.ItemsSource = mylist;
But i have tried all sorts of combinations to set it from the xaml. I think
i am being fought by the datacontext set for the top level form which points
at an XElement. The datacontext is needed to set the combobox text property
which is bound to an element in the xml.
do i somehow have to set a different datacontext for the combobox items??
or is there some other context to bind it to the class property that i am
missing??