Obtain reference to view created by Prism Navigation

59 Views Asked by At

In an application using the Prism framework, I'm adding a view to a region using the navigation features of the region manager like this:

_regionManager.RequestNavigate("DetailRegion",
    New Uri("EditUserView" + query.ToString(), UriKind.Relative))

Once the navigation has completed, I'd like to obtain a reference to the new that has been created. This is so that the view can be closed automatically when its parent is closed.

Is there a method in Prism (or otherwise) to do this? This is Prism 4.1?

1

There are 1 best solutions below

0
adminSoftDK On

Youd should be able to to do this

RegionManager.Regions["DetailRegion"].ActiveViews()

This will give you all active views for this region. The active view for this region should be the one that you just navigated to so .First() will get it.