BadgeUpdateManager
BadgeUpdateManager
BadgeUpdateManager
BadgeUpdateManager
BadgeUpdateManager
Class
Definition
Creates BadgeUpdater objects that you use to manipulate a tile's badge overlay. This class also provides access to the XML content of the system-provided badge templates so that you can customize that content for use in updating your badges.
public : static class BadgeUpdateManager
static struct winrt::Windows::UI::Notifications::BadgeUpdateManager
public static class BadgeUpdateManager
Public Static Class BadgeUpdateManager
// This class does not provide a public constructor.
- Attributes
Windows 10 requirements
Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Examples
The following example shows the use of GetTemplateContent to create the content for a numeric badge and CreateBadgeUpdaterForApplication to send a numeric badge update to the calling app's tile.
function sendBadgeNotification() {
var Notifications = Windows.UI.Notifications;
var badgeXml;
var badgeAttributes;
// Get an XML DOM version of a specific template by using getTemplateContent.
badgeXml = Notifications.BadgeUpdateManager.getTemplateContent(Notifications.BadgeTemplateType.badgeNumber);
badgeAttributes = badgeXml.getElementsByTagName("badge");
badgeAttributes[0].setAttribute("value", "7");
// Create a badge notification from the XML content.
var badgeNotification = new Notifications.BadgeNotification(badgeXml);
// Send the badge notification to the app's tile.
Notifications.BadgeUpdateManager.createBadgeUpdaterForApplication().update(badgeNotification);
}