Parent region is region state aware

Topics: Prism v2 - Silverlight 4
Oct 14, 2011 at 10:54 AM


I have a view in a parent region that contains several regions.  When a view contained within one of the child regions is displaying a validation error i.e the entity that the view is bound to has validation errors, then I want to run a storyboard animation on the parent region.  What is the best way to communicate to the view in the parent region that the view in the child region is in a 'has validation error' state and then to communicate that the validation errors have been resolved?  

I could use an prism event or is this something a custom region behavior achieve?

Any suggestions?



Oct 14, 2011 at 1:44 PM


In my opinion you could use the event aggregator to communicate this information between your views; region behaviors are mainly intended to address UI Composition behaviors (such as when to create a region, when to populate it with views from the registry, etc), so basically they're useful to extend the region mechanisms. In your case, your scenario implies passing information between decoupled components, which sounds like a good opportunity to use the event aggregator.

You can read more about the aforementioned topics on the following chapters from the Prism MSDN documentation:

I hope you find this helpful.

Guido Leandro Maliandi