two ways:
1. each object should contain a reference to it's parent. when a value in the object is changed, it sets it's own IsChanged property to true, which in turn sets it's parent's IsChanged property to true.
OR
2. each object throws an event when it has been changed. the parent object can hook onto the changed event of it's child objects and set it's own IsChanged property to true.
you use whichever of the two architectures you prefer. i much, much prefer #2, as you get so many more benefits in terms of ANYTHING being able to hook onto the event (plus it makes life easier if you want to implement an undo stack in your app).
hope that helps some. |