TileUpdateManager TileUpdateManager TileUpdateManager TileUpdateManager Class

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.

Syntax

Declaration

public static class TileUpdateManagerpublic static class TileUpdateManagerPublic Static Class TileUpdateManager

Remarks

This is a static factory class and requires no instantiation.

Examples

The following example shows GetTemplateContent(Windows.UI.Notifications.TileTemplateType) 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);
}

Methods summary

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

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.

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

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.

Methods

  • CreateTileUpdaterForApplication()
    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

  • CreateTileUpdaterForApplication(System.String)
    CreateTileUpdaterForApplication(System.String)
    CreateTileUpdaterForApplication(System.String)
    CreateTileUpdaterForApplication(System.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(System.String)public static TileUpdater CreateTileUpdaterForApplication(System.String)Public Static Function CreateTileUpdaterForApplication(System.String) As TileUpdater

    Parameters

    • applicationId
      System.String
      System.String
      System.String
      System.String

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

    Returns

    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.

  • CreateTileUpdaterForSecondaryTile(System.String)
    CreateTileUpdaterForSecondaryTile(System.String)
    CreateTileUpdaterForSecondaryTile(System.String)
    CreateTileUpdaterForSecondaryTile(System.String)

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

    public static TileUpdater CreateTileUpdaterForSecondaryTile(System.String)public static TileUpdater CreateTileUpdaterForSecondaryTile(System.String)Public Static Function CreateTileUpdaterForSecondaryTile(System.String) As TileUpdater

    Parameters

    • tileId
      System.String
      System.String
      System.String
      System.String

      A unique ID for the tile.

    Returns

    Remarks

    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);
    
  • GetTemplateContent(Windows.UI.Notifications.TileTemplateType)
    GetTemplateContent(Windows.UI.Notifications.TileTemplateType)
    GetTemplateContent(Windows.UI.Notifications.TileTemplateType)
    GetTemplateContent(Windows.UI.Notifications.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(Windows.UI.Notifications.TileTemplateType)public static XmlDocument GetTemplateContent(Windows.UI.Notifications.TileTemplateType)Public Static Function GetTemplateContent(Windows.UI.Notifications.TileTemplateType) As XmlDocument

    Parameters

    Returns

    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.

    Examples

    The following example shows GetTemplateContent(Windows.UI.Notifications.TileTemplateType) 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);
    

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MuseAttribute

Details

Assembly

Windows.UI.Notifications.dll