views:

56

answers:

1

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

The first page A contains two radio buttons. Depending which button has been selected by the user Next button will navigate to page B or page C.

The problem is when the user uses Back button on the NavigationWindow, change the selection on the first page and hit Forward button instead of Next button. Next event handler would reevaluate the logic and move to the proper page, but Forward button just get a page from the forward stack.

What is the recommend action in such situation? I couldn't find any details of such scenario on MSDN. I believe the easiest why to resolve this issue would be to clear forward stack when the user changed selection on the first page so only Next button is available. Unfortunately I don't know how to do it.

+1  A: 

Trying to resolve quite similar problem. Not yet make it working, but I'm looking to WPF PageFunctions.

A good description of page functions you can find by the link below, as well as greatest overview on WPF navigation I saw

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

Also you can suppress forward navigation using Navigating event handler. See http://stackoverflow.com/questions/25642/when-is-navigationservice-initialized

Andrii V