TileUpdateManager Class

创建用于更改和更新启动菜单图块的 TileUpdater 对象。此类还提供对系统提供的平铺模板 XML 内容的访问,以便您可以自定义用于更新您平铺的内容。

语法


var tileUpdateManager = Windows.UI.Notifications.TileUpdateManager;

特性

[Muse()]
[Threading(MTA)]
[Version(0x06020000)]

成员

TileUpdateManager类 具有这些类型的成员:

方法

The TileUpdateManager 类 具有这些方法。 对于 C#、Visual Basic 和 C++,它还继承方法于Object 类.

方法说明
CreateTileUpdaterForApplication() Creates and initializes a new instance of the TileUpdater, which lets you change the appearance of the calling app's tile.
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.
CreateTileUpdaterForSecondaryTile 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.
GetTemplateContent Gets the XML content of one of the predefined tile templates so that you can customize it for a tile update.

 

备注

这是静态工厂类,并不需要实例化。

示例

下面的示例显示了用于检索图块模板和 CreateTileUpdaterForApplication 中的 XML 内容的 GetTemplateContent,以便向应用程序的图块发送通知。



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);
}

要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

命名空间

Windows.UI.Notifications
Windows::UI::Notifications [C++]

元数据

Windows.winmd

另请参见

应用程序列表和徽章示例
快速入门:发送平铺更新
平铺和平铺通知概述
平铺模板目录
标题的准则和检查表
如何安排平铺通知
如何设置图块的时间通知
图块 XML 架构

 

 

显示:
© 2014 Microsoft