TileUpdateManager.CreateTileUpdaterForSecondaryTile(String) メソッド

定義

TileUpdater の新しいインスタンスを作成して初期化します。これにより、セカンダリ タイルの外観を変更できます。 タイルは、呼び出し元アプリまたは同じパッケージ内の他のアプリに属することができます。

public:
 static TileUpdater ^ CreateTileUpdaterForSecondaryTile(Platform::String ^ tileId);
 static TileUpdater CreateTileUpdaterForSecondaryTile(winrt::hstring const& tileId);
public static TileUpdater CreateTileUpdaterForSecondaryTile(string tileId);
function createTileUpdaterForSecondaryTile(tileId)
Public Shared Function CreateTileUpdaterForSecondaryTile (tileId As String) As TileUpdater

パラメーター

tileId
String

Platform::String

winrt::hstring

タイルの一意の ID。

戻り値

tileID で識別されるタイルに更新プログラムを送信するために使用するオブジェクト。

次の例では、セカンダリ タイルに通知を送信する方法を示します。

var Notifications = Windows.UI.Notifications;

// Define the notification content.
var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text04);
var tileTextAttributes = tileXml.getElementsByTagName("text");
tileTextAttributes[0].appendChild(tileXml.createTextNode("Sent to a secondary tile!"));

// Provide a medium version of the notification as well, remembering that the user has control 
// over whether the tile is displaying as wide or square.
var squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquare150x150Text04);
var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("Sent to a secondary tile!"));

// Add the medium tile to the notification.
var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
tileXml.getElementsByTagName("visual").item(0).appendChild(node);

// Create the notification based on the XML content.
var tileNotification = new Notifications.TileNotification(tileXml);

// Create a secondary tile updater and pass it the secondary tileId
var tileUpdater = Notifications.TileUpdateManager.createTileUpdaterForSecondaryTile("SecondaryTile.Dynamic");

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

適用対象

こちらもご覧ください