0

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:

The region manager does not contain the MainFileMenuRegion region

<Menu cal:RegionManager.RegionName="MainMenuRegion">
    <MenuItem cal:RegionManager.RegionName="MainFileMenuRegion" Header="_File" />
</Menu>
Adi Lester
  • 24,731
  • 12
  • 95
  • 110
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243

2 Answers2

0

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
  • 3,234
  • 5
  • 39
  • 66
0

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.

sourcenouveau
  • 29,356
  • 35
  • 146
  • 243