Frage

I have an app where there's a small panel that needs to support browser like navigation such has back, forward, and home. Thus it also needs to hold a history of panels the user has gone to. I don't think I can use NavigationWindow because only a small portion of the window will support navigation.

What is the best practice for doing this? I've been looking at NavigationService and the Navigation commands like NavigateBack and etc.. But it's kinda hard to tie this stuff together.

I'm using Prism/MEF as well.

War es hilfreich?

Lösung

You need to use the Journal of the region. If you get the Region manager and get a reference to the Prism Region instance defined for the panel. Then you can use the Journal of the Navigation service for the region to go back. You can also register to the Navigated event of the NavigationService for the region if you need to perform some action when the next view is navigated to.

mainRegion = this.RegionManager.Regions["MainRegionName"];   
mainRegion.NavigationService.Navigated += NavigationService_Navigated; 
mainRegion.NavigationService.Journal.GoBack();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top