views:

13

answers:

1

Hello! I have a Shell class with one region. I created a module which shows,for example, a list of offices. When I choose one of offices I want to show another module where I want to transfer information about chosen office. Questions:

  • what is better: to create another module or maybe to create just another view in existing?
  • (if I still want to create second module), how do I must to change views in region? Notice, I have only one region, so I need either hide view of first module or unload it.
  • What if I want to add one more region to shell? E.g. every module must contains 2 views and change all of them.

Thanks.

A: 

Hi,

I'll try to answer the questions separately.

  1. If the information you are going to show is related to that of the list view (say the details of a particular office), the common approach would be creating another view in the same module. This is because both views are related to offices and share related concerns, so having a separate module for them brings more pain than gain.
  2. Whether you do decide to create a second module or not, if you want to only have a sinlge region in the Shell and display only a view at a time, you must use as a Region's host a ContentControl, which acts as a SingleActiveRegion.
  3. If you want to add more regions to the Shell, just add more controls and mark them with the RegionManager dependency property for regions. Many of the Prism quickstarts show this. To communicate between modules just use the EventAggregator.

I hope this helps.

Damian Schenkelman
hmm.. Ok, I'll try it. Looks like it is what I need
Andrey Stukalin
how about marking it as an answer then? usually when users provide an answer that is useful, the common practice is to vote it up/mark it as answer. read the faq here: http://stackoverflow.com/faq.
Damian Schenkelman
This is really helpful! Thanks!
Andrey Stukalin