CompositeCommand in a view within a scoped region

Topics: Prism v2 - WPF 3.5
Feb 20, 2010 at 7:54 PM

I have a view that was added to a scoped region.  This view references a composite command that is defined globally (static) to the application.  I toggle the active state of all commands registered with the composite command when the active state of the view changes, i.e., IActiveAware.  My issue is that the scoped view is always active because scoped views are never made aware of when a parent view is activated or deactivated.  I have written a region behavior called SyncIsActiveAwareBehavior which syncs the active state of scoped views based upon the active state of a parent view (owner of the scoped region,) but I'm not sure if this is the best way to handle this type of scenario.  Is there any guidance on how best to work with scoped regions?  It seems like Prism really breaks down once you have to manage a lot of scoped regions, say in a MDI interface.  I'm hoping that there is some guidance in this area currently and that future versions of Prism will provide a better programming model for dealing with scoped regions.

Mar 28, 2011 at 12:10 PM

jcain or anyone else,

I'm also facing the same issue and I was wondering if anyone can think of a nice solution.

I was hoping that there would be an elegant way of registering a scoped region to it's parent-regions IActiveAware notifications.....

Mar 28, 2011 at 4:05 PM
Edited Mar 28, 2011 at 4:07 PM


The solution proposed by jcain seems to be a valid workaround for achieving your scenario. I've copied this into a work item in the Issue Tracker, so that the possibility of adding a behavior that syncs the ActiveAware state of the views throughout scoped regions to a future version is considered.

Thank you four your feedback.

Guido Leandro Maliandi

May 23, 2011 at 6:27 PM


The user tearaway_Tea has asked the following question in the work item associated to this thread:

"Hey, is it possible to get the implementation of yours SyncIsActiveAwareBehavior? Could you attach a file or something. Thanks!"


Guido Leandro Maliandi