I'mm building a WPF app with MVVM and am using ObservableCollection. While working on my ViewModel, I decided to inspect the type definition of the ObservableCollection and I saw something that I thought was odd:
// class definition for ObservableCollection
ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged
// derives from Collection<T>
...
// class definition for Collection<T>
Collection<T> : IList<T>, ICollection<T>, IEnumerable<T> ... (as well as non-generics)
Now, here's the question:
If ICollection<T> implements IEnumerable<T>
AND
IList<T> implements ICollection<T> AS WELL AS IEnumerable<T>
...
...
Why does Collection<T> implement ALL THREE?
Is this really how its implemented or is this VS2010 playing tricks on me?