I want to add an event handler to an observable collection that will be triggered each time items are added, removed, or updated in it.
The CollectionChanged event is raised when items are added or removed but is not raised when items are replaced e.g. with something like this
obsList[5] = MyUpdatedCustomObject;
Any suggestions?
I thought, you can’t do this, the indexer:
is inherited from
Collection<T>class, this indexer is not virtual to change its behavior!But actually, when I tested on a very tiny application, the event will fire in your case, you have something wrong, please supply some extra code!