Prism IRegionNavigationJournal.GoBack not working

As the name says, I have a problem with the IRegionNavigationJournal GoBack method. First of all, my scenario:

2 Prismatic Modules 1 Prism Shell with Content Region

I am only looking at RegionManager.RequestNavigate("region", "ModuleName") . In addition, I register View and View ViewModel in a single container using ModuleName

One of the modules is the dashboard module, where the second module (and each additional module) registers the navigateto command. This command requests the transition to module 2.

Everything works fine, the dashboard requests a transition to the content area, the command 2 of the navigateto module is displayed and displays.

After pressing the navigateto command of the second module, the second module is displayed in the content area.

In addition, each module injects a GoBack command into the shell to execute IRegionNavigationJournal.GoBack plus module-specific elements inside the OnNavigateTo method.

Each ViewModel implements INavigationAware (more precisely, it is implemented in the base view model). Inside OnNavigatedTo, I save the NavigatioService. After raising the GoBack command of module 2, the last action performed is to call OnNavigateFrom of module 2. OnNavigateTo of the panel is never called. View module 2 remains in the content area, etc.

If I debug the application, then IRegionNavigationJournal backstack says 1 entry with Uri "DashBoard".

Some snippets of code:

register types:

 container.RegisterType<object, DashboardViewModel>(new ContainerControlledLifetimeManager()); container.RegisterType<object, DashboardView>(ModuleResources.ModuleName, new ContainerControlledLifetimeManager()); 

navigation request:

 regionManager.RequestNavigate(ShellRegionNames.ContentRegion, ModuleResources.ModuleName); 

come back:

  navigationService.Journal.GoBack(); 

Hope someone can help.

Thank you in advance

+4
source share
1 answer

It seems that the string in the RegisterType<T> method should be the same as the class name for the view. A RequestNavigate(RegionName, ViewName) works with different lines, the GoBack() bit does not work.

+1
source

All Articles