BadgeUpdateManager.CreateBadgeUpdaterForApplication Method

Definition

Overloads

CreateBadgeUpdaterForApplication()

Creates and initializes a new instance of the BadgeUpdater, which lets you change the appearance or content of the badge on the calling app's tile.

CreateBadgeUpdaterForApplication(String)

Creates and initializes a new instance of the BadgeUpdater for a specified app tile's badge, usually the tile of another app in the package. The BadgeUpdater lets you change the appearance or content of that badge.

CreateBadgeUpdaterForApplication()

Creates and initializes a new instance of the BadgeUpdater, which lets you change the appearance or content of the badge on the calling app's tile.

public:
 static BadgeUpdater ^ CreateBadgeUpdaterForApplication();
/// [Windows.Foundation.Metadata.Overload("CreateBadgeUpdaterForApplication")]
 static BadgeUpdater CreateBadgeUpdaterForApplication();
[Windows.Foundation.Metadata.Overload("CreateBadgeUpdaterForApplication")]
public static BadgeUpdater CreateBadgeUpdaterForApplication();
function createBadgeUpdaterForApplication()
Public Shared Function CreateBadgeUpdaterForApplication () As BadgeUpdater

Returns

The object you will use to send changes to the app tile's badge.

Attributes

Examples

The following example shows CreateBadgeUpdaterForApplication used to send a numeric badge update to the calling app's tile.

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

See also

Applies to

CreateBadgeUpdaterForApplication(String)

Creates and initializes a new instance of the BadgeUpdater for a specified app tile's badge, usually the tile of another app in the package. The BadgeUpdater lets you change the appearance or content of that badge.

public:
 static BadgeUpdater ^ CreateBadgeUpdaterForApplication(Platform::String ^ applicationId);
/// [Windows.Foundation.Metadata.Overload("CreateBadgeUpdaterForApplicationWithId")]
 static BadgeUpdater CreateBadgeUpdaterForApplication(winrt::hstring const& applicationId);
[Windows.Foundation.Metadata.Overload("CreateBadgeUpdaterForApplicationWithId")]
public static BadgeUpdater CreateBadgeUpdaterForApplication(string applicationId);
function createBadgeUpdaterForApplication(applicationId)
Public Shared Function CreateBadgeUpdaterForApplication (applicationId As String) As BadgeUpdater

Parameters

applicationId
String

Platform::String

winrt::hstring

The unique ID of the tile whose badge you want to update.

Returns

The object you will use to send changes to the application tile's badge.

Attributes

Remarks

The app identified by applicationId must belong to the same package as the caller.

See also

Applies to