有3个xaml页面,其中2个用不同的参数调用第三页。如何在第三页中写入onNavigatedTo()?
使用NavigationService.Navigate(new Uri("/third.xaml?paramter=xxxx", UriKind.Relative));
答案 0 :(得分:0)
从http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626521(v=vs.105).aspx借用并修改此代码。
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
string msg = "";
if (NavigationContext.QueryString.TryGetValue("parameter", out msg))
// now your parameter is in the msg variable, and you could do stuff here.
}