[英]Passing Values between two xaml Pages in Windows Phone 8 App
In the Below Code, I want to pass Value of TextBlock1 which is in Navigation Page to the TextBlock2 which is in the Destination Page...! 在下面的代码,我想通过TextBlock1的值,它是在导航页面的TextBlock2这是在目标页面...!
Code in Navigation Page : 导航页中的代码 :
NavigationService.Navigate(new Uri("/Views/DestinationPage.xaml?parameter=textBlock1.Text", UriKind.Relative));
Code in Destination Page : 目标页面中的代码 :
string parameter = string.Empty;
if (NavigationContext.QueryString.TryGetValue("parameter", out parameter))
{
this.textBlock_Result.Text = parameter;
}
Navigation page: 导航页:
NavigationService.Navigate(new Uri("/Views/DestinationPage.xaml?parameter=" + textBlock1.Text, UriKind.Relative));
Destination Page : 目标页面:
if(NavigationContext.QueryString.TryGetValue(“parameter”,out parameter))
{
this.textBlock_Result.Text = parameter;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.