다음을 통해 공유


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를 사용하여 호출 앱의 타일에 숫자 배지 업데이트를 보내는 방법을 보여 드립니다.

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

적용 대상

추가 정보