This is a follow-up to my question, How does WPF handle CollectionChanged events for custom collections?.
According to Alex.Wei's answer (and the source code of IndexedEnumerable) WPF ignores the specifics of the NotifyCollectionChangedEventArgs (e.g. Action) and always reacts the same, ultimately as if Action == Reset.
So my questions: Who uses NotifyCollectionChangedEventArgs' features and, if I raise the event manually (for a custom class) does it make sense to specifiy the details (if they are never evaluated)? Also, why does WPF behave like this - isn't this a potential performance killer?
I am sorry if I didn't make things clear in last anwser. Actually, WPF behaves according to specifics of the
NotifyCollectionChangedEventArgslike it means to be, andIndexedEnumerablejust a tool that letCollectionViewor other componets of WPF access to the source collections that didn't implementIListthrongh an index easily. For example, after you bind a collection toItemsControl.ItemsSource, the things in below will happen.ItemsControlwill specify the collection as the source of itsItemsproperty.Itemsproperty which is anItemCollectionwill obtain aCollectionViewby callingCollectionViewSource.GetDefaultCollectionViewmethod.CollectionChangedevent of the source collection and act accordingly.ItemCollectionwill also subscribeCollectionChangedevent of the view and act accordingly.ItemsControlsubscribeCollectionChangedevent of theItemsand act accordingly form the beginning.So, the answer to you questions is that a lot of WPF classes are using
NotifyCollectionChangedEventArgs' features and you definitely need to riaseCollectionChangedevent correctly by providing all the details whatever you collection was implementedIListor not.