Windows 通知系统的实现与应用
1. 吐司通知(Toast Notifications)
在 Windows 系统中,吐司通知是一种常见的即时提醒方式。下面我们将详细介绍如何创建和处理吐司通知。
1.1 安排吐司通知
安排吐司通知意味着将通知请求加入队列,并在指定的日期显示。以下是一个示例代码:
ready: function (element, options) { var count = 0; btn_toast.onclick = function () { count++; var toast_xml = Windows.UI.Notifications.ToastNotificationManager .getTemplateContent(Windows.UI.Notifications.ToastTemplateType .toastImageAndText01); toast_xml.documentElement.setAttribute("duration", "long"); // 设置文本 var text_node = toast_xml.documentElement.getElementsByTagName("text")[0]; text_node.appendChild(toast_xml.createTextNode( "A toast notification me