积极答复者
页面跳转传值问题(A页面先跳B页面,在B页面选定一个值后,再跳回A页面并传递给A页面)

问题
答案
-
可以通过以下两种方法实现:
1. 在B页面选择值,跳转A页面时,不使用Frame.GoBack(); ,而使用Frame.Navigate(typeof(APage), Value);
选择值通过Value 传递,同时在跳转后从BackStack中去掉B页面。
2. 在B页面选择值后,将值存在App.xaml.cs中一个变量中。使用Frame.GoBack();返回A页面,并读取这个变量。
- 已建议为答案 shao.mengModerator 2014年6月25日 4:27
- 已标记为答案 Jamles HezModerator 2014年6月28日 2:56
-
还有第三个方案,不一定是App.xaml.cs中的变量,也可以是本地临时的变量,参考一下Windows Store App教程中的例子(http://msdn.microsoft.com/zh-cn/library/windows/apps/hh986968.aspx ),使用的就是最最简单的本地存储,ApplicationData是一个极好的选择。
最简单的还是shao.meng提到的第一个,使用Navigation来完成传值任务。
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已建议为答案 shao.mengModerator 2014年6月25日 4:27
- 已标记为答案 Jamles HezModerator 2014年6月28日 2:56
全部回复
-
可以通过以下两种方法实现:
1. 在B页面选择值,跳转A页面时,不使用Frame.GoBack(); ,而使用Frame.Navigate(typeof(APage), Value);
选择值通过Value 传递,同时在跳转后从BackStack中去掉B页面。
2. 在B页面选择值后,将值存在App.xaml.cs中一个变量中。使用Frame.GoBack();返回A页面,并读取这个变量。
- 已建议为答案 shao.mengModerator 2014年6月25日 4:27
- 已标记为答案 Jamles HezModerator 2014年6月28日 2:56
-
还有第三个方案,不一定是App.xaml.cs中的变量,也可以是本地临时的变量,参考一下Windows Store App教程中的例子(http://msdn.microsoft.com/zh-cn/library/windows/apps/hh986968.aspx ),使用的就是最最简单的本地存储,ApplicationData是一个极好的选择。
最简单的还是shao.meng提到的第一个,使用Navigation来完成传值任务。
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已建议为答案 shao.mengModerator 2014年6月25日 4:27
- 已标记为答案 Jamles HezModerator 2014年6月28日 2:56