使用后退按钮 [英] Using the Back Button

查看:89
本文介绍了使用后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Windows Phone 8应用程序(C#,XAML)

I'm developing a Windows Phone 8 App (C#, XAML)

我对后退按钮有些困惑.

I'm a bit confused about the back button.

我有3页:

MainPage.xaml

MainPage.xaml

Page1.xaml

Page1.xaml

Page2.xaml

Page2.xaml

  1. 应用打开,显然向用户显示MainPage.xaml.
  2. 他们在MainPage.xaml上进行选择,将其带到Page1.xaml.

  1. 在此页面上,他们在文本框中输入了一些文本.
  2. 其中一个文本框旁边有一个按钮,可将它们带到Page2.xaml.

  1. 在Page2.xaml上,还需要填写一些文本框来执行计算.
  2. 还有一个名为过程计算和存储参数"的按钮.当用户单击此按钮时,它将计算参数.
  3. ...存储参数.
  4. 然后导航回到Page1.xaml
  1. On Page2.xaml there are some more textboxes that need to be filled in that perform a calculation. 
  2. There is also a button named "Process Calculation and Store Parameters".  When the user clicks this button, it calculates the parameters.
  3. ...Stores the parameters.
  4. Then navigates back to Page1.xaml

这是问题所在.到此为止,在Page1.xaml上,如果用户单击电话上的后退"按钮,则不会使我回到MainPage.xaml,而是使我回到Page2.xaml.我不希望这种情况发生.有办法吗 要将Page2.xaml从内存中删除或当用户单击过程计算和存储参数"按钮时将其销毁?

Here is the problem.  While we are at this point, on Page1.xaml, if the user clicks the back button on the phone, it doesn't bring me back to MainPage.xaml but it brings me back to Page2.xaml.  I don't want this to happen.  Is there a way to remove Page2.xaml from memory or destroy it when the user clicks on the button "Process Calculation and Store Parameters"?

谢谢

推荐答案

嗨Tpolo,

Hi Tpolo,

您可以使用NavigationService.RemoveBackEntry方法删除堆栈条目,请参见以下链接.

You  can use the NavigationService.RemoveBackEntry Method to remove the stack entry see the following links.

希望它会有所帮助.


这篇关于使用后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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