I have a class (let\'s call it MyContainerClass
)that is a container for several other classes (let\'s call them ClassA
to ClassF
). C
Okay, here is what I did after staring at Eren's solution for a while: I also implemented the INotifyPropertyChanged for the container class and registered the PropertyChanged
event for each object.
objA.PropertyChanged += updateCount;
objB.PropertyChanged += updateCount;
objC.PropertyChanged += updateCount;
...and so on. Then I added the following method
private void updateCount(object sender, PropertyChangedEventArgs e)
{
OnPropertyChanged("Count");
}
Now I have the behavior that I want.