Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 2.14 KB

badgenotification_badgenotification_93177318.md

File metadata and controls

41 lines (28 loc) · 2.14 KB
-api-id -api-type -api-device-family-note
M:Windows.UI.Notifications.BadgeNotification.#ctor(Windows.Data.Xml.Dom.XmlDocument)
winrt method
xbox

Windows.UI.Notifications.BadgeNotification.BadgeNotification

-description

Creates and initializes a new instance of the BadgeNotification.

-parameters

-param content

The XML content that defines the badge update.

-remarks

The value attribute can be a number from 1-99 or a status glyph. See the Badge overview for a complete list of available images.

-examples

The following example code uses the BadgeNotification method to create a numeric badge notification.

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

-see-also

App tiles and badges sample, Badge overview, Guidelines and checklist for tiles and badges, How to clear a badge, How to send a glyph or numeric badge in a local notification, How to set up periodic notifications for badges, How to update a badge through push notifications, Badge XML schema