简体   繁体   English

点击吐司通知栏

[英]Click on toast notification bar

I send toast notification to mobile with Windows Phone 7. When I'm out of application I get bar at top on screen with my title and description. 我使用Windows Phone 7将烤面包通知发送至手机。当我退出应用程序时,屏幕顶部会显示我的标题和说明。 That is great. 太棒了。
But how can I handle event when I click this bar? 但是,单击此栏时如何处理事件?

You can specify a page that the user will be navigated to along with parameters when your app opens via clicking on the toast notification. 您可以通过单击Toast通知来指定在打开应用程序时用户将与参数一起导航到的页面。 It's called deep linking and you can read about it on MSDN . 这称为深度链接 ,您可以在MSDN上阅读有关它的信息。

The XML that you send should include an additional element called Param . 您发送的XML应该包含一个称为Param的附加元素。

<wp:Param>[stuff goes here]</wp:Param>

You have three options of what you can supply: 您可以提供三种选择:

/page1.xaml – Defines the screen to navigate to in the app when the app starts. /page1.xaml –定义在应用启动时导航至应用中的屏幕。 The string must begin with a "/". 字符串必须以“ /”开头。

/page1.xaml?value1=1234 &amp;value2=9876 – Defines the screen to navigate to when the app starts, along with name/value pairs of info. /page1.xaml?value1=1234 &amp;value2=9876 –定义应用启动时导航至的屏幕,以及名称/值对信息。 The string must begin with a "/". 字符串必须以“ /”开头。

?value1=1234 &amp;value2=9876 – Contains name/value pairs of info passed to the default start screen of the app. ?value1=1234 &amp;value2=9876 –包含传递到应用程序默认启动屏幕的信息的名称/值对。 The string must begin with a "?". 字符串必须以“?”开头。

You can then then pick these up in your page like so: 然后,您可以像下面这样在页面中进行选择:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    string strVal1 = this.NavigationContext.QueryString["value1"];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM