Sprache

BadgeUpdater.Update(BadgeNotification) Methode

Definition

Wendet eine Änderung auf die Glyphe oder Nummer des Badges an.

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)

Parameter

notification
BadgeNotification

Das -Objekt, das die neue XML-Definition für das Badge bereitstellt.

Beispiele

Das folgende Beispiel zeigt die Verwendung von Update, um ein numerisches Signalupdate an die Kachel der aufrufenden App zu senden.

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

Gilt für:

Weitere Informationen