Hussein
Hussein

Reputation: 989

Prism: Nested Regions

I googled a lot but i didn't find an exact answer. I'm using Prism-Mef, i have RegionB which is nested inside RegionA When i declare:

IRegion regionB= regionManager.Regions[RegionNames.RegionB];

i got the exception:

The region manager does not contain the RegionB region.

Thanks in advance.

Upvotes: 1

Views: 380

Answers (1)

Richard Friend
Richard Friend

Reputation: 16018

Assuming you created a scoped RegionManager - you need to use the scoped region manager of the view that contains the inner region.

var scopedRegionManager = RegionManager.GetRegionManager(view);
var regionB = scopedRegionManager.Regions[RegionNames.RegionB];

Upvotes: 2

Related Questions