从导航堆栈中删除页面 [英] Remove a page from Navigation Stack

查看:38
本文介绍了从导航堆栈中删除页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个应用程序架构:

I have this application schema :

[List Page] -> [Detail Page] -> [ShareOnFacebook Page]
                     ^__________________|

  1. 用户在[List Page]
  2. 中选择一个Item
  3. 用户可能会也可能不会单击 Share 按钮,如果他或她这样做,应用程序将导航到 [ShareOneFacebook 页面],其中显示 Facebook 登录表单、帖子一条消息并返回
  4. 用户返回.
  1. The user select an Item in the [List Page]
  2. The user may or may not click a Share button if he or she does, the application navigates to a [ShareOneFacebook page] which displays a Facebook Login Form, posts a message and navigates back
  3. The user navigates back.

如果用户在 facebook 上分享,它将重新发布"消息,因为应用程序存储会话,因此它将导航回 ShareOnFacebook,然后返回到我的详细信息页面.

If the user shared on facebook, it will "repost" the message, because the application store the session so it will navigate back to ShareOnFacebook, and then back to my Detail page.

如果用户没有分享,他将返回列表页面.

If the user didn't share, he goes back to the List Page.

如何忽略"导航堆栈中的 ShareOnFacebook 页面?

How can I "ommit" the ShareOnFacebook page in my navigation stack ?

推荐答案

试试这个:OnNavigatedTo中调用NavigationService.RemoveBackEntry();> 方法.这将从堆栈中删除上一页.在我看来,Navigation.GoBack(); 的技巧并不令人满意,因为它会在短时间内显示要删除的页面.

Try this: Call NavigationService.RemoveBackEntry(); in the OnNavigatedTo method. This will remove the previous page from the stack. In my opinion the trick with Navigation.GoBack(); is not satisfying because it shows the page to remove for a short time.

注意:仅适用于 Windows Phone OS 7.1 (Mango) SDK

Note: Works only with Windows Phone OS 7.1 (Mango) SDK

这篇关于从导航堆栈中删除页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆