Nested menu regions in Composite WPF application
Question
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>
Solution 2
One workaround I've come up with is to simply use two Menu
s 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.
OTHER TIPS
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow