Do you need to synchronize the two collections immediately upon an update or can you defer it to when the whole graph gets committed? If you can wait then the best thing is probably to override the Save method on the root object and do the work there.
If you need immediate sync then it's trickier. I've used a couple of techniques - you can hook into the ListChanged event of your child collection but you don't get much information from it. In the end I hid the Add event of my child class (using the new keyword in c#), delegated the call to the base class (base.Add(item)) and then could do the sync work after that.
When I have run in to this requirement in the past, I have used a mediator object whose only job is to handle the syncing of the two collections. This mediator would live in the parent root object. It registered for the appropriate events from each child collection, and handled the update logic. What I liked is that the mediator class has a single responsibility, and the implementation is nicely encapsulated. In my particular case I was using the ActiveObjects code and CSLA 1.4, but that is merely an implementation detail.
Best Regards,
Fintan
Copyright (c) Marimer LLC