1

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.
  • 1-How i can access RegionB to Add view to it, knowing that i will use it as a scoped region.

  • 2-If i have a third level of nesting: for example RegionC which is nested inside RegionB, how can use RegionC to add a View

Thanks in advance.

Hussein
  • 945
  • 1
  • 12
  • 30

1 Answers1

2

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];
Richard Friend
  • 15,800
  • 1
  • 42
  • 60