R – Why ObservableCollection is not updated on items change

observablecollectionwpf

I noticed that ObservableCollection in WPF reflects changes in GUI only by adding or removing an item in the list, but not by editing it.

That means that I have to write my custom class MyObservableCollection instead.
What is the reason for this behaviour?

Thanks

Best Solution

The ObservableCollection has no way of knowing if you make changes to the objects it contains - if you want to be notified when those objects change then you have to make those objects observable as well (for example by having those objects implement INotifyPropertyChanged)

Related Question