BadgeUpdateManager.CreateBadgeUpdaterForApplication 方法

定義

多載

CreateBadgeUpdaterForApplication()

建立並初始化 BadgeUpdater的新實例,可讓您變更呼叫應用程式磚上徽章的外觀或內容。

CreateBadgeUpdaterForApplication(String)

為指定的應用程式磚徽章建立並初始化 BadgeUpdater 的新實例,通常是套件中另一個應用程式的磚。 BadgeUpdater可讓您變更該徽章的外觀或內容。

CreateBadgeUpdaterForApplication()

建立並初始化 BadgeUpdater的新實例,可讓您變更呼叫應用程式磚上徽章的外觀或內容。

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

傳回

您將用來將變更傳送至應用程式磚徽章的物件。

屬性

範例

下列範例顯示用來將數值徽章更新傳送至呼叫應用程式的磚的 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);
}

另請參閱

適用於

CreateBadgeUpdaterForApplication(String)

為指定的應用程式磚徽章建立並初始化 BadgeUpdater 的新實例,通常是套件中另一個應用程式的磚。 BadgeUpdater可讓您變更該徽章的外觀或內容。

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

參數

applicationId
String

Platform::String

winrt::hstring

您想要更新其徽章之磚的唯一識別碼。

傳回

您將用來將變更傳送至應用程式磚徽章的物件。

屬性

備註

由 applicationId識別的應用程式必須屬於與呼叫端相同的套件。

另請參閱

適用於