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

New Post: Nested Regions

$
0
0
Hi Damian,
Thanks for your quick response.
i have the following method in ControllerB in ModuleB which is triggered by EventAggregator
to add ViewB="TestPacksView" in RegionB="TestPackGridRegion" which is nested inside RegionA
that exist in a ViewA in ModuleA.
How exactly i can modify this code to access the nested region "TestPackGridRegion" and add "TestPacksView"
 private void ShowTestPacksGrid(PreCommissioning.Model.Subsystem Subsys)
        {   
            IRegion pipingRegion = regionManager.Regions[RegionNames.TestPackGridRegion];
            
            object existingView = pipingRegion.GetView("TestPacksView");


            if (existingView == null)
            {
                // the view does not exist yet. Create it and push it into the region
                testPacksViewModel.SetSubsystem(Subsys);

                existingView = ServiceLocator.Current.GetInstance<ITestPacksView>();
                pipingRegion.Add(existingView, "TestPacksView",true);
            }
            else
            {
                // The view already exists. Just show it. 
                pipingRegion.Activate(existingView);
            }
            
            
        }

Your help is very much appreciated.

Viewing all articles
Browse latest Browse all 1878

Trending Articles



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