BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(String) Methode

Definition

Erstellt und initialisiert eine neue instance von BadgeUpdater, mit der Sie die Darstellung oder den Inhalt eines Badges auf einer sekundären Kachel ändern können. Die Kachel kann zur aufrufenden App oder einer beliebigen anderen App im selben Paket gehören.

public:
 static BadgeUpdater ^ CreateBadgeUpdaterForSecondaryTile(Platform::String ^ tileId);
 static BadgeUpdater CreateBadgeUpdaterForSecondaryTile(winrt::hstring const& tileId);
public static BadgeUpdater CreateBadgeUpdaterForSecondaryTile(string tileId);
function createBadgeUpdaterForSecondaryTile(tileId)
Public Shared Function CreateBadgeUpdaterForSecondaryTile (tileId As String) As BadgeUpdater

Parameter

tileId
String

Platform::String

winrt::hstring

Die eindeutige ID der Kachel.

Gibt zurück

Das Objekt, das Sie zum Senden von Badgeupdates an die Kachel verwenden, die durch tileID identifiziert wird.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie eine numerische Signalbenachrichtigung mit der ID "SecondaryTile.Dynamic" an eine sekundäre Kachel gesendet wird.

var Notifications = Windows.UI.Notifications;

// Define the badge content
var badgeNotification = Notifications.BadgeUpdateManager.getTemplateContent(Notifications.BadgeTemplateType.badgeNumber);
var badgeAttributes = badgeNotification.getElementsByTagName("badge");
badgeAttributes[0].setAttribute("value", "6");

// Create the notification based on the XML content.
var badge = new Notifications.BadgeNotification(badgeNotification);

// Create a secondary tile updater, passing it the ID of the tile.
Notifications.BadgeUpdateManager.createBadgeUpdaterForSecondaryTile("SecondaryTile.Dynamic");

// Send the notification to the secondary tile.
tileUpdater.update(tileNotification);

Gilt für:

Weitere Informationen