TileUpdater 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
變更更新程式所系結之特定磚的內容。
public ref class TileUpdater sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class TileUpdater final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class TileUpdater final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class TileUpdater
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class TileUpdater
Public NotInheritable Class TileUpdater
- 繼承
- 屬性
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 引進)
|
範例
下列範例顯示用來將通知傳送至應用程式磚的 Update 。
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);
}
下列程式程式碼使用 EnableNotificationQueue 來啟用呼叫應用程式磚的通知佇列。
Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication().enableNotificationQueue(true);
下列範例顯示 RemoveFromSchedule 方法的使用方式。
var notifier = Notifications.TileUpdateManager.createTileUpdaterForApplication();
var scheduled = notifier.getScheduledTileNotifications();
for (var i = 0, len = scheduled.length; i < len; i++) {
// The itemId value is the unique ScheduledTileNotification.Id assigned to the
// notification when it was created.
if (scheduled[i].id === itemId) {
notifier.removeFromSchedule(scheduled[i]);
}
}
備註
若要取得這個物件的實例,請呼叫 TileUpdateManager.CreateTileUpdaterForApplication 或 TileUpdateManager.CreateTileUpdaterForSecondaryTile 方法。
建立時,TileUpdater 會系結至特定的應用程式或次要磚,因此此類別的方法只會影響物件實例所系結的單一磚。
屬性
Setting |
取得值,指定是否可以透過通知更新磚。 |