I’ve got this issue with my WPF application — I’m using an ObservableCollection<T> to bind the UI to a collection of players. This list gets updated every 10 seconds with new data streamed from a game server. The problem is that blowing away the list and re-adding everything causes for some terrible UI inconsistencies:
- selected items become deselected
- context menus open become unbound and useless
- possibly some errors cropping up from all the item instances being lost
So I am asking if there is any way I can update values for an item that don’t match the previous value. I do still need it to be DataBinding friendly for the UI (auto updating on PropertyChanged).
If you can find the players in the collection, you can simply map the updated property values to them. If the player itself implements INotifyPropertyChanged, it should work with very little effort.