I have an observableCollection and have wired up an event in MyObject, is there an cunnign way to grab that event in the collection without having to re-write the collection class?
public class MyObjectCollection : ObservableCollection<MyObject>
{
public MyObjectCollection()
{
//some cunning code here
}
}
I suspect I have to re-write the ObservableCollection Class, but unfortunatly there is no interface (like there is an IDictionary)
Favor composition over inheritance. Instead of extending ObservableCollection, implement the interfaces you need (probably INotifyCollectionChanged and IList) and keep an ObservableCollection as a private field. That way you can wire your own add and remove calls and do what you want with the objects added to the collection.