Eliminating Forward Entries in NavigationService

I have a small sample application hosted in a WPF NavigationWindow. It has three pages (A, B, C) and three buttons are available to the user: Back and Forward in the navigation window and Next on the first page.

The first page A contains two switches. Depending on which button was selected by the user, Next button will go to page B or page C.

The problem is when the user uses the Back button in the NavigationWindow, changes the selection on the first page, and clicks the Forward button instead of the Next button. The next event handler will revise the logic and navigate to the correct page, but the Forward button will just get the page from the front stack.

What is the recommended action in this situation? I couldn't find any details about such a scenario on MSDN. I find the easiest solution to this problem is to clear the stack forward when the user changes the selection on the first page so that only the Next button is available. Unfortunately, I don't know how to do this.

+2


a source to share


1 answer


Trying to solve a similar problem. Doesn't work yet, but I'm looking for WPF PageFunctions.

A good description of page features that you can find at the link below, as well as the largest overview of WPF navigation. I have seen



http://www.paulstovell.com/wpf-navigation

You can also disable forward navigation using the navigation event handler. See When is the NavigationService Function Initialized?

+3


a source







All Articles