[英]Can I set parameter using NavigationContext.QueryString? (Windows Phone)
Can I pass value to Navigation Context like this: 我可以将值传递给导航上下文,如下所示:
NavigationContext.QueryString["param1"] = "PARAM1";
Is it a good way to set parameter? 这是设置参数的好方法吗?
First of all, why you need to store some parameters in NavigationContext.QueryString
? 首先,为什么需要在NavigationContext.QueryString
存储一些参数? There are exists another good places for this. 还有另一个好的地方。
If you want to pass parameters to another page, use this: 如果要将参数传递给其他页面,请使用以下命令:
NavigationService.Navigate(new Uri("SomePage.xaml?param1=PARAM1"))
if you need to save some values to the state dictionary, you can use PhoneApplicationService.Current.State
(global) or PhoneApplicationPage.State
(page specific) 如果需要将某些值保存到状态字典,可以使用PhoneApplicationService.Current.State
(global)或PhoneApplicationPage.State
(特定于页面)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.