Share via


BadgeUpdateManager 클래스

정의

타일의 배지 오버레이를 조작하는 데 사용하는 BadgeUpdater 개체를 만듭니다. 또한 이 클래스는 배지 업데이트에 사용할 콘텐츠를 사용자 지정할 수 있도록 시스템 제공 배지 템플릿의 XML 콘텐츠에 대한 액세스 권한을 제공합니다.

public ref class BadgeUpdateManager abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class BadgeUpdateManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class BadgeUpdateManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public static class BadgeUpdateManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public static class BadgeUpdateManager
Public Class BadgeUpdateManager
상속
Object Platform::Object IInspectable BadgeUpdateManager
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

다음 예제에서는 GetTemplateContent 를 사용하여 숫자 배지에 대한 콘텐츠를 만들고 CreateBadgeUpdaterForApplication 을 사용하여 호출 앱의 타일에 숫자 배지 업데이트를 보내는 방법을 보여 줍니다.

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

설명

버전 기록

Windows 버전 SDK 버전 추가된 값
1607 14393 GetForUser

메서드

CreateBadgeUpdaterForApplication()

호출 앱 타일에서 배지의 모양이나 콘텐츠를 변경할 수 있는 BadgeUpdater의 새 instance 만들고 초기화합니다.

CreateBadgeUpdaterForApplication(String)

지정된 앱 타일의 배지(일반적으로 패키지에 있는 다른 앱의 타일)에 대한 BadgeUpdater의 새 instance 만들고 초기화합니다. BadgeUpdater를 사용하면 해당 배지의 모양이나 콘텐츠를 변경할 수 있습니다.

CreateBadgeUpdaterForSecondaryTile(String)

보조 타일에서 배지의 모양이나 콘텐츠를 변경할 수 있는 BadgeUpdater의 새 instance 만들고 초기화합니다. 타일은 호출 앱 또는 동일한 패키지의 다른 앱에 속할 수 있습니다.

GetForUser(User)

지정된 사용자에 대한 새 BadgeUpdateManagerForUser 를 만들고 초기화하여 특정 사용자의 타일에서 배지의 모양이나 콘텐츠를 변경할 수 있습니다.

GetTemplateContent(BadgeTemplateType)

배지 업데이트를 위해 사용자 지정할 수 있도록 미리 정의된 배지 템플릿 중 하나의 XML 콘텐츠를 가져옵니다.

적용 대상

추가 정보