BadgeNotification(XmlDocument) 建構函式

定義

建立並初始化 BadgeNotification的新實例。

public:
 BadgeNotification(XmlDocument ^ content);
 BadgeNotification(XmlDocument const& content);
public BadgeNotification(XmlDocument content);
function BadgeNotification(content)
Public Sub New (content As XmlDocument)

參數

content
XmlDocument

定義徽章更新的 XML 內容。

範例

下列範例程式碼會使用 BadgeNotification 方法來建立數值徽章通知。

var Notifications = Windows.UI.Notifications;

var badgeXml = Notifications.BadgeUpdateManager.getTemplateContent(Notifications.BadgeTemplateType.badgeNumber);
var badgeAttributes = badgeXml.getElementsByTagName("badge");
badgeAttributes[0].setAttribute("value", "26");

// Create a badge notification from XML
var badgeNotification = new Notifications.badgeNotification(badgeXml);

備註

value 屬性可以是 1-99 的數位或狀態字元。 如需可用映射的完整清單,請參閱 徽章概觀

適用於

另請參閱