When implementing INotifyCollectionChanged
and raising the CollectionChanged
event, you must provide a NotifyCollectionChangedAction
argument. Which NotifyCollectionChangedAction
is used to indicate that an item in the collection has changed, such as in the case where an item's value changes?
Asked
Active
Viewed 672 times
0

sourcenouveau
- 29,356
- 35
- 146
- 243
2 Answers
5
If it's the same object, but a field changes (e.g. same Person, but different Person.Photo), the collection didn't change. Otherwise, every change to the collection is one of the Enum values.
If one Person is replaced by another, that's a Replace.

Matthew Flaschen
- 278,309
- 50
- 514
- 539
-
3Generally, items within a collection that implements `INotifyCollectionChanged` will implement `INotifyPropertyChanged`. – Stephen Cleary Jun 02 '10 at 13:51
-
Ah, OK. I fixed my mental model ^_^ – sourcenouveau Jun 02 '10 at 13:52
0
If a property of an item has changed, but the item (i.e. the object) has remained the same, you should use INotifyPropertyChanged on the item.

Daniel Rose
- 17,233
- 9
- 65
- 88