Wpf combobox text not updating
Object Instance = obj1 End Sub Private Sub btn_List2_Click(By Val sender As System. This method uses the Equals method to determine equality. However, when I click a button to switch the Object Instance to obj2, the Combo Box Items Source gets populated correctly in the dropdown, but the Selected Value is set to Nothing instead of being equal to obj2. Problem: The Combo Box class searches for the specified object by using the Index Of method. took me more than a week to resolve this small fyn. In WPF, everytime you navigate to a Page everything gets re-initialized, constructor gets called, loaded methods, everything.so if you are setting your Data Context inside your View you will no doubt be blowing away that Selected Item that the user selected.(Note - the values in the combobox list do update).
It turned out that when I added a check to make sure the proposed value for Key Type was not null, everything worked as expected. So i wrote a class Equality Brush containing a Brush and implementing Equals: It could be the way you are applying the Data Context to the Page.
I think this could be done in the template of the combobox - somehow make the textbox be bound to the selecteditem of the combobox, or always update when it updates?
EDIT: I didn't make clear - I do implement INotify Property Changed properly and when the value changes I raise Property Changed for my List and my Selected Item.
So you will need to ensure that you are setting the Data Context on Initialize (either externally or within the constructor) rather than Load.
However, this will only work for that instance of the Page.