删除 Windows Phone 芒果中的返回条目 [英] Remove back entry in windows phone mango

查看:28
本文介绍了删除 Windows Phone 芒果中的返回条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除 wp7.1 中的后堆栈.当我从 A 导航到 B 时,我有 3 个页面并说 A、B、C,而在 B 中,有一个按钮可以添加新的联系方式.当我单击它时导航到页面 C,在页面 C 中有一个完成按钮,当我点击完成按钮时,页面导航到页面 A 的主页当我从页面 A 单击后退按钮时,页面 C 是可见的,因为它没有完成.我怎样才能清除后退堆栈.另外让我知道是否有任何方法可以从后退堆栈中清除特定页面.如果后退堆栈包含页面 A、B、C、D,我必须清除 C 和 D 的最后两页.Windows Phone Mango 中可能吗?

how can i remove back stack in wp7.1.I have 3 pages and say A,B,C when i navigate from A to B and in B there is a button to add new contact detail.when i click it page navigate to page C and In page C there is a Done button and when i clicked done button the page navigate to home page that is the page A and when i clicked back button from page A.the page C is visible since it is not finished.How can i clear the back stack.Also let me know is there any method to clear a particular page from the back stack.if the back stack contain page A,B,C,D and i have to clear the last two pages that is C and D.is that possible in the windows phone Mango?

推荐答案

在主页面的Load Event处,放入如下代码:

On the Load Event of the main page, put the following code:

while (NavigationService.CanGoBack)
{
    NavigationService.RemoveBackEntry();
}

我不确定这是否是一个好的做法,但由于在 Mango 中用户应该通过单击后退按钮关闭他们的应用程序,我认为这是避免支持整个历史的好方法.

I'm not sure whether it's a good practice, but since in Mango users are supposed to close their apps by clicking the back button, I think it's a good way to avoid backing the whole history.

这篇关于删除 Windows Phone 芒果中的返回条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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