删除 Windows Phone 芒果中的返回条目

编程入门 行业动态 更新时间:2024-10-24 04:31:15
本文介绍了删除 Windows Phone 芒果中的返回条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

如何删除 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-25 14:12:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117734.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:条目   芒果   Windows   Phone

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!