Search code examples
c#.netinotifycollectionchanged

Why does INotifyCollectionChanged use IList


Reading up here, I undestand why it is not IList<T>. But why IList at all? It makes no sense to add to it, so it should be just an IEnumerable, or if you really want an indexer (no reason why), use a ReadOnlyCollection.


Solution

  • Take a look at NotifyCollectionChangedEventArgs.

    It has NewStartingIndex and OldStartingIndex properties.

    So the design is based on Indexable collections, I assume this is convenient for eg Listboxes.