Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: how to create multi-shell window application using Prism 4.0 and MEF with MVVM

$
0
0

Hi,

Based on my understanding, using the ViewExport attribute approach to register views will not allow you to specify a customRegionManager, this can be seen in the AutoPopulateExportedViewsBehaviorwhich discovers the views exported in the container with this attribute and automatically populates them into the associated region. In which case if this behavior was registered by overriding theConfigureDefaultRegionBehaviors in the bootstrapper, it will be attached to each region by default no matter if they are in differentRegionManagers unless this behavior is only added to an specific region. After running some tests I could verify that the views registered with this approach were added to regions in different region manager from different windows.

Based on this, I believe that if you need explicit control on which RegionManagerthe views will be added then the recommended approach is using View Injection in which case the views should be added programmatically instead of using declarative attributes (you can find more information about this inChapter 7: Composing the User Interface of thePrism documentation). When following this approach, you will need to define some logic to retrieve eachRegionManager attached to each window. This could be done for example by using a shared service, or if you can retrieve each instance of the created windows you could access theRegioManager property where you stored each corresponding RegionManager.

On the other hand, as you may find using the View Discovery approach may also not be adequate to achieve this kind of scenarios as out of the box. Although as mentioned in the following work item, some changes could be made to use this approach with an specific RegionManager:

I hope you find this handy,

Agustin Adami
http://blogs.southworks.net/aadami


Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>