BadgeUpdater.Update(BadgeNotification) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Applies a change to the badge's glyph or number.
public:
virtual void Update(BadgeNotification ^ notification) = Update;
void Update(BadgeNotification const& notification);
public void Update(BadgeNotification notification);
function update(notification)
Public Sub Update (notification As BadgeNotification)
Parameters
- notification
- BadgeNotification
The object that supplies the new XML definition for the badge.
Examples
The following example shows the use of Update to send a numeric badge update to the calling app's tile.
// Get an XML DOM version of a specific template by using GetTemplateContent.
var badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
var badgeAttributes = badgeXml.GetElementsByTagName("badge");
badgeAttributes[0].Attributes.Where(a => a.LocalName.ToString() == "value").First().NodeValue = "7";
// Create a badge notification from the XML content.
var badgeNotification = new BadgeNotification(badgeXml);
// Send the badge notification to the app's tile.
BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(badgeNotification);