gpt4 book ai didi

c# - 点击 toast 通知栏

转载 作者:太空宇宙 更新时间:2023-11-03 13:47:46 25 4
gpt4 key购买 nike

我使用 Windows Phone 7 向手机发送 toast 通知。当我退出应用程序时,我会在屏幕顶部看到带有我的标题和描述的栏。太好了。
但是单击此栏时如何处理事件?

最佳答案

您可以指定一个页面,当您的应用程序通过单击 toast 通知打开时,用户将被导航到该页面以及参数。它被称为深层链接,您可以在MSDN 上阅读它。 .

您发送的 XML 应包含一个名为 Param 的附加元素。

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

您可以提供三种选择:

/page1.xaml – Defines the screen to navigate to in the app when the app starts. 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. 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. The string must begin with a "?".

然后您可以像这样在您的页面中选择这些:

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

关于c# - 点击 toast 通知栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14707407/

25 4 0