tags:

views:

367

answers:

2

Is it possible to have nested regions in a Composite WPF application? I want modules to be able to inject new menus, and also be able to inject menu items into an existing menu.

Using the following code the RegionManager throws an exception saying "The region manager does not contain the MainFileMenuRegion region":

<Menu cal:RegionManager.RegionName="MainMenuRegion">
    <MenuItem cal:RegionManager.RegionName="MainFileMenuRegion" Header="_File" />
</Menu>
A: 

I don't know whether its 'right' but I do nesting by having a region on the injected view that I then inject the sub view into.

Andy Clarke
Interesting, but I need to inject into a region and a subregion which are both in the shell.
emddudley
A: 

One workaround I've come up with is to simply use two Menus arranged with a Grid. The first one has all my standard menus and allows me to inject into each one individually. The second is empty and allows me to inject new top-level menus.

emddudley