BadgeUpdater.Update(BadgeNotification) 方法

定义

对锁屏提醒的字形或编号应用更改。

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)

参数

notification
BadgeNotification

为锁屏提醒提供新 XML 定义的 对象。

示例

以下示例演示了如何使用 Update 将数字锁屏提醒更新发送到调用应用的磁贴。

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

适用于

另请参阅