Share via


TileUpdateManager.CreateTileUpdaterForSecondaryTile(String) Method

Definition

Creates and initializes a new instance of the TileUpdater, which enables you to change the appearance of a secondary tile. The tile can belong to the calling app or any other app in the same package.

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

Parameters

tileId
String

Platform::String

winrt::hstring

A unique ID for the tile.

Returns

The object you will use to send updates to the tile identified by tileID.

Examples

The following example demonstrates how to send a notification to a secondary tile.

var tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Text04);
var tileTextAttributes = tileXml.GetElementsByTagName("text");
tileTextAttributes[0].AppendChild(tileXml.CreateTextNode("Sent to a secondary tile!"));

var squareTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text04);
var squareTileTextAttributes = squareTileXml.GetElementsByTagName("text");
squareTileTextAttributes[0].AppendChild(squareTileXml.CreateTextNode("Sent to a secondary tile!"));

var node = tileXml.ImportNode(squareTileXml.GetElementsByTagName("binding").Item(0), true);
tileXml.GetElementsByTagName("visual").Item(0).AppendChild(node);

var tileNotification = new TileNotification(tileXml);
var tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile("SecondaryTile.Dynamic");
tileUpdater.Update(tileNotification);

Applies to

See also