I have a combobox and I am binding the combobox in XAML with viewmodel dictionary values.
When the page is loaded for first time I am trying to download the dictionary values and from server and set it to the dictionary view model variable.
But the combobox looks empty I don't understand why this happens because View Model variable has been updated and thats supposed to trigger the reload of combobox and thats not happening..
FYI: If I hardcode the dictionary rather than downloading it from server I don't see this problem When I load the page second time I don't see this problem
Update
XAML
<ComboBox x:Name=“testBox” Margin=“0,0,0,0” PlaceholderText="{StaticResource testText}” ItemsSource="{Binding TestDictionary.Values}” SelectedValue="{Binding DictionaryValue, Mode=TwoWay}" IsEnabled="{Binding IsItLoading, Converter={StaticResource InverseBooleanConverter}}"/>
View Model
private Dictionary<string, string> testDictionary;
public Dictionary<string, string> TestDictionary
{
get
{
if (this.testDictionary == null)
{
this.testDictionary = new Dictionary<string, string>();
}
return this.testDictionary;
}
set
{
this.Set(() => this.TestDictionary, ref this.testDictionary, value);
}
}