Bil*_*lal 1 c# notifications toast windows-8 windows-runtime
我正在开发一个应用程序,我正在使用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)
这是结果:

谢谢
在Windows 8.0/8.1中,您无法执行此操作,因为我们没有"交互式"Toast通知,如果您要这样做,则应升级到Windows 10.