[英]How to add buttons to Windows 8 Toast Notification?
我正在開發一個應用,並且正在使用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";
結果如下:
謝謝
在Windows 8.0 / 8.1中,您無法執行此操作,因為我們沒有“交互式”吐司通知,如果要這樣做,則應升級到Windows 10。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.