I have a class (let's call it MyContainerClass
)that is a container for several other classes (let's call them ClassA
to ClassF
). ClassA
to ClassF
inherit the same base class (let's call it MyBaseClass
). In MyBaseClass
I have an int property with the name Count
, which ClassA
to ClassF
inherit. I also have an int property with the same name in MyContainerClass
which is the sum of ClassA
to ClassF
.
Then I have a datagrid, and each row has one object of MyContainerClass
. The columns of the grid show ClassA
to ClassF
. The last column in the grid shows a total (that is it is bound the Count
property of MyContainerClass
). Now I want that the total in the last column updates as soon as I change the Count
property in any class in the A-F range. I implemented INotifyPropertyChanged in MyBaseClass
and it does fire when I change the Count
property in ClassA
to ClassF
. But the last column in my datagrid remains the same. Any clues?
EDIT:
I have created a class diagram.
The getCount() method returns objA.Count+objB.Count+...+objF.Count and is returned by the Count
property in the MyContainerClass
. The question is: if I update objA.Count I want the GUI (that is the column in my datagrid) to display the updated sum.