TileUpdateManager 類別

定義

建立 TileUpdater 物件,用來變更和更新 [開始] 功能表磚。 這個類別也提供系統所提供磚範本之 XML 內容的存取權,讓您可以自訂該內容以用於更新磚。

public ref class TileUpdateManager abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class TileUpdateManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class TileUpdateManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public static class TileUpdateManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public static class TileUpdateManager
Public Class TileUpdateManager
繼承
Object Platform::Object IInspectable TileUpdateManager
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

下列範例顯示用來擷取磚範本的 XML 內容和CreateTileUpdaterForApplicationGetTemplateContent,以將通知傳送至應用程式的磚。

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 版本 SDK 版本 新增值
1607 14393 GetForUser

方法

CreateTileUpdaterForApplication()

建立並初始化 TileUpdater的新實例,讓您變更呼叫應用程式磚的外觀。

CreateTileUpdaterForApplication(String)

建立並初始化 TileUpdater 的新實例,該磚屬於與呼叫應用程式相同套件中的另一個應用程式。 TileUpdater可讓開發人員變更該磚的外觀。

CreateTileUpdaterForSecondaryTile(String)

建立並初始化 TileUpdater的新實例,這可讓您變更 次要磚的外觀。 磚可以屬於呼叫的應用程式或相同套件中的其他任何應用程式。

GetForUser(User)

為指定的使用者建立並初始化新的 TileUpdateManagerForUser ,讓您變更特定使用者磚的外觀或內容。

GetTemplateContent(TileTemplateType)

取得其中一個預先定義磚範本的 XML 內容,以便您可以自訂磚更新。

注意

在 Windows 8 系統上呼叫此方法時,它會傳回 第 1 版範本。 在Windows 8.1系統上呼叫此方法時,它會傳回第 2 版範本。 不過,如果應用程式在其資訊清單中指定 Windows 8 相容性,這個方法會傳回 第 1 版範本

適用於

另請參閱