May 20, 2009 at 6:59 PM
Edited May 20, 2009 at 6:59 PM
I have thought of two possible approaches for the scenario you just described.
If your menu belongs to a specific module, you could just create a view through XAML in that module, that contains your menu
items. This is because no other items will be added from other modules, so there is no need to attach a region to the menu. For this scenario WPF
might be a good option. There is a really good sample from
Julian Dominguez (prism-v1 and v2 developer) that shows how to use Presentation Models with DataTemplates in WPF (includes source code):
Presentation Model with DataTemplates in CompositeWPF (Prism) Sample.
If your menu contains items from different modules you could use
In Prism-v2 regions are the placeholders that will display one or more views at runtime, therefore allowing UI Composition.
Regions are usually populated with views (that are in modules). The most common approach is defining views in modules, and adding them to regions.
So if you want to add
MenuItems to a region, you could create different views in your modules (each could contain just a menu item) and add them to a
The following articles provide more information about the topics I mentioned above:
How to: Show a View in a Region Using View Discovery UI Composition
How to: Show a View in a Region Using View Injection UI Composition
How to: Create a View with a Presenter
Please let me know if this helps.