Loading complex module within a shell

Topics: Prism v2 - Silverlight 2, Prism v2 - WPF 3.5
Apr 22, 2009 at 10:28 AM
Hi all, I created a shell with 2 regions:
  1. MenuRegion;
  2. ApplicationRegion;

In the MenuRegion, the shell loads a module that display a menu. When user select an item from the menu, the shell loads a module on demand (AppModule) in the ApplicationRegion.
Think at the shell like a container of applications. The user select an item from the menu, and the relative application will be loaded.
The problem is that the application to load (AppModule) in the ApplicationRegion is quite complex, so I think to use regions and modules inside it.
What are the best practice to do this? How can I create the AppModule that use it's own ModuleCatalog and it's own regions?

Thanks.

Apr 22, 2009 at 9:08 PM
Edited Apr 22, 2009 at 9:10 PM

Hi,

 

Though I don't know your exact scenario, I think you won't need to have a special ModuleCatalog (different than the one used to load the AppModule). The ModulesCatalog in Prism is accessible to any module and can be used to load other modules.

If your AppModule is complex you can declare as many regions as you need within its views. Moreover your AppModule can load other modules as needed that will in turn register their views into the those regions.

 

Another feature you can use to have a RegionManager delimited to the AppModule’s View is Scoped Regions.

 

You can find a sample of a module that loads another module in the Modularity QuickStarts. You might find the following articles from the documentation useful:

·         UI Composition (Design Concept)
·         UI Composition (Technical Concept)
·         Modularity (design Concept) 
·      Module (Technical Concept) 

 
Hope it helps!

 
Matias Bonaventura
http://blogs.southworks.net/matiasb

Apr 23, 2009 at 8:05 AM
Thank you for your reply!
Scoped Regions are what I am looking for. They solved my problem.

Thank you,
Giuseppe.