gpt4 book ai didi

c# - 如何将按钮添加到 Windows 8 Toast 通知?

转载 作者:太空宇宙 更新时间:2023-11-03 19:54:04 26 4
gpt4 key购买 nike

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

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

这是一个示例,显示了 Windows 8 Toast 通知上的按钮但我无法重命名 (snooze) 按钮文本,也无法在我的代码中添加它的事件处理程序。

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";

结果如下:

demo

谢谢

最佳答案

在 Windows 8.0/8.1 中你不能这样做,因为我们没有“交互式”toast 通知,如果你想这样做,你应该升级到 Windows 10。

Adaptive/ Interactive Toast notifications - Windows 10

关于c# - 如何将按钮添加到 Windows 8 Toast 通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35708983/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com