开发者

Clearing forward entries in NavigationService

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 navigat开发者_StackOverflow中文版e 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.


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 When is NavigationService initialized?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜