After looking at this MSDN article, I am now wondering what the benefit, if any, is of defining a collection as a class that inherits from ObservableCollection
. Are there any significant differences between this:
class MyCollection : ObservableCollection<MyObject> { }
class Class1
{
private MyCollection _newCollection = new MyCollection();
public Class1()
{
_newCollection.Add(new MyObject());
}
}
and this:
class Class1
{
private ObservableCollection<MyObject> _newCollection = new ObservableCollection<MyObject>();
public Class1()
{
_newCollection.Add(new MyObject());
}
}
Is there something I'm overlooking here?