小编Bil*_*lal的帖子

如何在Windows 8 Toast通知中添加按钮?

我正在开发一个应用程序,我正在使用Windows 8 Toast通知

我需要的是显示通知时我需要两个按钮; 第一个被解雇(我们在示例中有这个)和第二个将在我的代码中实现事件,如果用户按下它我需要执行代码应用程序.

这是一个示例,显示Windows 8 Toast通知上的按钮,但我无法重命名(贪睡)按钮文本,并且无法在我的代码中添加其事件处理程序.

string toastXmlString =
"<toast duration=\"long\">\n" +
"<visual>\"<binding template=\"ToastText02\">\n" +
"<text id=\"1\">Alarms Notifications SDK Sample App</text>\n" +
"<text id=\"2\">" + alarmName + "</text>\n" +
"</binding>\n" +
"</visual>\n" +
"<commands scenario=\"alarm\">\n" +
"<command id=\"snooze\"/>\n" +
"<command id=\"dismiss\"/>\n" +
"</commands>\n" +
"</toast>\n";
Run Code Online (Sandbox Code Playgroud)

这是结果:

演示

谢谢

c# notifications toast windows-8 windows-runtime

1
推荐指数
1
解决办法
669
查看次数

标签 统计

c# ×1

notifications ×1

toast ×1

windows-8 ×1

windows-runtime ×1