I have an Array bound to a ComboBox.
My issue is that I can't find a way to default ComboBox element to any of the ones in the Array, i.e. it's empty when loading the User Control.
Would this be due to the way I load the array (from a dictionnary)?
XAML binding:
<WrapPanel>
<ComboBox ItemsSource="{Binding Path=ExclusionDescriptions}" SelectedValue="{Binding Path=Description, Mode=TwoWay}" IsSynchronizedWithCurrentItem="True" SelectedIndex="0"/>
</WrapPanel>
Code:
public string[] ExclusionDescriptions
{
get
{
return GetDescriptionsAndEntityScope().Keys.ToArray();
}
}
With:
private Dictionary<string, bool> GetDescriptionsAndEntityScope()
{
return GetDescriptionsAndEntityScope();
}