BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(String) Метод

Определение

Создает и инициализирует новый экземпляр BadgeUpdater, который позволяет изменять внешний вид или содержимое эмблемы на вторичной плитке. Плитка может принадлежать вызывающей или любому другому приложению в том же пакете.

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

Параметры

tileId
String

Platform::String

winrt::hstring

Уникальный идентификатор плитки.

Возвращаемое значение

Объект, который будет использоваться для отправки обновлений индикатора событий на плитку, определяемую tileID.

Примеры

В следующем примере показано, как отправить числовое уведомление индикатора событий на вторичную плитку с идентификатором SecondaryTile.Dynamic.

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

Применяется к

См. также раздел