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

New Post: RegionManager does not contain nested region issue

$
0
0
Hi,

I have a wpf application using prism and mef.
In my Shell I have define ModuleRegion.
In moduleRegion, when I load ModuleA, ModuleAMainView is loaded. ModuleAMainView has nested region LeftRegion and RightRegion.
ModuleAMainViewModel is implementing INavigationAware interface.

When I try to access LeftRegion and RightRegion in OnNavigateTo function:-

var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
var cregion = regionManager.Regions["LeftRegion"];

I get exception that region is not present.

regionManager contains only those regions which are defined in Shell.
Also if I try to call these line in UserControlLoaded event then I can see that regionManager has all the nested regions.

How to access these regions in OnNavigateTo functions.

Regards,
Sharda.

Viewing all articles
Browse latest Browse all 1878

Trending Articles



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