Tile​Update​Manager Tile​Update​Manager Tile​Update​Manager Class

Definition

Creates TileUpdater objects used to change and update Start menu tiles. This class also provides access to the XML content of the system-provided tile templates so that you can customize that content for use in updating your tiles.

public : static class TileUpdateManagerpublic static class TileUpdateManagerPublic Static Class TileUpdateManager
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following example shows GetTemplateContent used to retrieve the XML content of a tile template and CreateTileUpdaterForApplication to send the notification to the app's tile.


function sendTileTextNotification() {
    var Notifications = Windows.UI.Notifications;

    // Get an XML DOM version of a specific template by using getTemplateContent.
    var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text03);

    // You will need to look at the template documentation to know how many text fields a particular template has.
    // Get the text attribute for this template and fill it in.
    var tileAttributes = tileXml.getElementsByTagName("text");
    tileAttributes[0].appendChild(tileXml.createTextNode("Hello World!"));

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

    // Send the notification to the calling app's tile.
    Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
}

Remarks

This is a static factory class and requires no instantiation.

Methods

CreateTileUpdaterForApplication() CreateTileUpdaterForApplication() CreateTileUpdaterForApplication()

Creates and initializes a new instance of the TileUpdater, which lets you change the appearance of the calling app's tile.

public : static TileUpdater CreateTileUpdaterForApplication()public static TileUpdater CreateTileUpdaterForApplication()Public Static Function CreateTileUpdaterForApplication() As TileUpdater
Returns

The object you will use to send changes to the app's tile.

Attributes
See Also

CreateTileUpdaterForApplication(String) CreateTileUpdaterForApplication(String) CreateTileUpdaterForApplication(String)

Creates and initializes a new instance of the TileUpdater for a tile that belongs to another app in the same package as the calling app. The TileUpdater lets a developer change the appearance of that tile.

public : static TileUpdater CreateTileUpdaterForApplication(PlatForm::String applicationId)public static TileUpdater CreateTileUpdaterForApplication(String applicationId)Public Static Function CreateTileUpdaterForApplication(applicationId As String) As TileUpdater
Parameters
applicationId
PlatForm::String String String

The Package Relative Application ID (PRAID) of the tile.

Returns

The object you will use to send changes to the tile identified by applicationId.

Attributes

Remarks

This method is used only in conjunction with multi-app packages. The app identified by applicationId must belong to the same package as the caller.

Although you can specify the calling application's tile in this method, createTileUpdaterForApplication is the preferred method to use with single-app packages.

See Also

CreateTileUpdaterForSecondaryTile(String) CreateTileUpdaterForSecondaryTile(String) CreateTileUpdaterForSecondaryTile(String)

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)public static TileUpdater CreateTileUpdaterForSecondaryTile(String tileId)Public Static Function CreateTileUpdaterForSecondaryTile(tileId As String) As TileUpdater
Parameters
tileId
PlatForm::String String String

A unique ID for the tile.

Returns

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

Attributes

Examples

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


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

GetForUser(User) GetForUser(User) GetForUser(User)

Creates and initializes a new TileUpdateManagerForUser for the specified user, which lets you change the appearance or content of a tile for a specific user.

public : static TileUpdateManagerForUser GetForUser(User user)public static TileUpdateManagerForUser GetForUser(User user)Public Static Function GetForUser(user As User) As TileUpdateManagerForUser
Parameters
user
User User User

The user who will recieve the tile updates.

Returns

An object that will update tiles for the specified user.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

GetTemplateContent(TileTemplateType) GetTemplateContent(TileTemplateType) GetTemplateContent(TileTemplateType)

Gets the XML content of one of the predefined tile templates so that you can customize it for a tile update.

Note

When this method is called on a Windows 8 system, it returns a version 1 template. When this method is called on a Windows 8.1 system, it returns a version 2 template. However, if an app specifies Windows 8 compatibility in its manifest, this method returns a version 1 template.

public : static XmlDocument GetTemplateContent(TileTemplateType type)public static XmlDocument GetTemplateContent(TileTemplateType type)Public Static Function GetTemplateContent(type As TileTemplateType) As XmlDocument
Parameters
type
TileTemplateType TileTemplateType TileTemplateType

The name of the template.

Returns

The object that contains the XML.

Attributes

Examples

The following example shows GetTemplateContent used to retrieve the XML content of a tile template.



var tileTemplate = Windows.UI.Notifications.TileTemplateType.tileWide310x150Text03;
var tileXml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent(tileTemplate);

Remarks

You can use Document Object Model (DOM) manipulation functions to customize the template content for use in a TileNotification update that you will send to the tile through the TileUpdater that you create through the other methods of this class.

See tile schema for an explanation of tile elements and attributes.

See Also

See Also