Update
After a bit of investigating. What seems to be the issue is that the SelectedValue/SelectedItem is occurring before the Item source is finis
ComboBox.SelectionBoxItem.ToString()
Have you tried implementing INotifyPropertyChanged
in your viewmodel, and then raise the PropertyChanged
event when the SelectedItem
gets set?
If this in itself doesn't fix it, then you will be able to manually raise the PropertyChanged
event yourself when navigating back to the page, and that should be enough to get WPF to redraw itself and show the correct selected item.
I have noticed this behavior before as well. I have noticed that the SelectedIndex property doesn't cause the same bug. If you can restructure your ViewModel to expose the index of the selected item, and bind to that, you should be good to go.
IsSyncronizedWithCurrent=False will make it work.
Setting IsSynchronizedWithCurrentItem="True"
worked for me!
The type of the SelectedValuePath
and the SelectedValue
must be EXACTLY the same.
If for example the type of SelectedValuePath
is Int16
and the type of the property that binds to SelectedValue
is int
it will not work.
I spend hours to find that, and that's why I am answering here after so much time the question was asked. Maybe another poor guy like me with the same problem can see it.