I am caught in the classic oop problem where my class needs to inherit from two base classes that I have no control over.
I have a TreeView control that has a hierarchy of my "BusinessUnit" classes. This class has a property called "Subclasses" that is an ObservableCollection of BusinessUnits. I'm using SimpleMVVM so that I need to notify property
changes to the view from the view model.
I wanted to use the method "NotifyPropertyChanged" on the setter of the Subclasses property to ensure the TreeView knows when this changes. To do this, I inherited BusinessUnit from ViewModelBase even though it is not the actual ViewModel
for the View. This actually worked very well and the TreeView receives the events when that property changes.
Unfortunately, I also need to control the tree from code. I need to expand nodes and select node programmatically. Even in Code Behind I can't seem to do this because my tree nodes do not derive from TreeViewItem.
So my problem is that I cannot inherit my BusinessUnit class from both ViewModelBase and TreeViewItem.
Does anyone have any suggestions?