简体   繁体   English

我可以使用NavigationContext.QueryString设置参数吗? (Windows Phone)

[英]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.

相关问题 如何检查NavigationContext.QueryString? - How do I check for NavigationContext.QueryString? Windows Phone 8出现NavigationContext.QueryString.TryGetValue()错误 - Windows Phone 8 Error with NavigationContext.QueryString.TryGetValue() 使用querystring获取参数C#Windows Phone 7 - using querystring to get a parameter c# windows phone 7 以下代码在Windows Phone 8中有效,但是当我转换为Windows Phone 8.1时NavigationContext不起作用 - The following code is working in Windows Phone 8 but when i convert into Windows Phone 8.1 NavigationContext is Not Working 在Windows Phone 8.1中不包含NavigationContext的定义 - Does not contain a definition for NavigationContext in Windows Phone 8.1 如何加密 id 查询字符串参数 - How can I encrypt the id querystring parameter Windows Phone 7,我可以将参数传递给ScheduledTaskAgent进行实时磁贴更新吗? - Windows Phone 7, can I pass a parameter to ScheduledTaskAgent for a live tiles update? 如何更改/设置Windows Phone 8中的默认字体系列 - how can i change/set default fontfamily in windows phone 8 如何在Windows Phone 8应用程序中设置时间? - How can I set the time in my Windows Phone 8 application? 我可以使用Request.Url.Query自动删除querystring上的参数吗? - Can I automatically remove a parameter on querystring with Request.Url.Query?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM