I have the following ComboBox:
<ComboBox SelectedItem="{Binding SelectedTheme, Mode=TwoWay}" ItemsSource="{Binding Themes, Mode=OneTime}" />
It is associated with the following values ββin my virtual machine:
private Theme _selectedTheme; public Theme SelectedTheme { get { return _selectedTheme; } set { if (_selectedTheme != value) { _selectedTheme = value; OnPropertyChanged(); } } } public List<Theme> Themes => Enum.GetValues(typeof(Theme)).Cast<Theme>().ToList();
I set the SelectedTheme value to VM ctor, and the get element gets after I assigned the VM instance to my Page DataContext . My problem is that the user interface does not reflect the value of the binding on the first page load; it updates correctly all the other time, but the combobox does not show any choice after the page loads.
source share