Interesting - no one has ever asked for this capability.
Good framework design dictates that things are only made visible, virtual or otherwise extensible when there's a valid reason to do so. Since this has never come up, you can see why it isn't possible :)
I'll add it to the wish list. In CSLA 4 the Parent properties are becoming public, and this seems like a reasonable change to go along with that change.
Maybe PropertyChanged would work. Maybe PropertyChanged would break data binding.
Raising that event for parent-child interactions has proven to be problematic in the past - though those cases were ones where the parent raised the event due to something the child did. Maybe it would be OK for the child to raise the event based on something the parent did. Extensive testing would be required across all smart client UI models.
Making the method virtual seems a lot simpler :)
nelis:It is only recently that I understood that PropertyChanged is mainly meant to inform UIs to update. Not so much to detect actual changes in property values (or am I wrong ?)
We just found ourselves in the same spot... we want to be able to detect when the parent has changed. My understanding, from reading this thread, is that there is now a wish list item for v4.0 to make SetParent virtual.
We are in a situation such that we will not be able to upgrade to v4.0 ('soon'?) so I was thinking about making this change to our CSLA 3.8.2 code base (taking the hit to make this change every time we upgrade 3.8.x)... do you think this is a 'safe' change to make?
I think that change is already in CSLA 4, so you can copy the implementation from svn if you'd like.
FYI, It looks like the changes were made to the core lib, but not the silverlight lib.
Copyright (c) Marimer LLC