I have a list of servers and a separate list of server roles. The name of the server is editable in the servers list. The same list is presented as a combo box in the server roles list. The combobox in the server roles list binds to the same ObservableCollection that the servers list binds to.
Whenever a server’s name is updated, the combobox is updated with the new name, however, the selected item still uses the old name.
old name: local
selected value: local
new name: local2
Combobox item value: local2
Expected selected value: local2
Actual selected value: local
I was loading the selecteditems from the disk and the servers were different objects in the server roles list.
Make sure that the items in the combobox are the same object references as the items in the list.