【问题标题】:parameter passing between XAML in windows phonewindows phone 中 XAML 之间的参数传递
【发布时间】:2013-08-02 06:46:51
【问题描述】:

有3个xaml页面,其中2个调用带有不同参数的第三个页面。第三页怎么写onNavigatedTo()?

我正在使用NavigationService.Navigate(new Uri("/third.xaml?paramter=xxxx", UriKind.Relative));

【问题讨论】:

标签: c# windows-phone-7


【解决方案1】:

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.

    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-08
    相关资源
    最近更新 更多