3
votes

I want to create an application with Silverlight & Prism where the user can navigate like this:

enter image description here

The red rectangles depict regions with different Prism modules inside (6 different modules in this example).

What is the best way to approach the following issues:

  • AFAIK the regions in the shell do not change, but I cannot create the different layouts I want by using the same regions (e.g. once the modules are stacked horizontally and once vertically). Would having multiple shells be a good option here?

  • I am aware of the Region Navigation Pipeline that can be used to switch between views in a region. Can this also be used to switch between different Shells?

  • Navigating between shells feels wrong, but how else could I solve this?

This seems like it would be a common scenario, but I can't find information on it. Most apps, even complex ones (i.e. http://blogs.msdn.com/b/erwinvandervalk/archive/2009/03/02/how-to-build-an-outlook-style-application.aspx, http://www.codeproject.com/Articles/165370/Creating-View-Switching-Applications-with-Prism-4, StockTrader RI ) use only one shell with a layout that never changes, but what if the layout has to change?

1

1 Answers

6
votes

DISCLAIMER: I am a WPF Prism Programmer, so my answer may not work for Silverlight.

I would not go with the mulit-shell route. Rather I would have regions inside of regions.

NOTE: Before you can design this though, you need to ask if you can make your content in a way that it can go both horizontal or vertical (ie binding to Orientation and using WrapPanels). If you can then you can just reuse your actual content regions.

You could design this by having one shell that houses several regions that have their visibility controlled by your app.

For Example: After a successful Login, the Login region is hidden and the StyleSelector region is shown (with the A and B button).

After one of those is pressed, then the StyleSelector region is hidden and you show the either the VerticalContentPresenter region or the HorizontalContentPresenter region.

Each of the xxxxxxxContentPresenter regions has two regions inside of it.

As I said above, depending on how your controls are, you can re-use the same regions inside the xxxxxxContentPresenter regions (and could even have those be the same region too).