BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立並初始化 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);
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應