TileUpdater TileUpdater TileUpdater TileUpdater TileUpdater Class

Definition

Changes the content of the specific tile that the updater is bound to.

public : sealed class TileUpdater : ITileUpdater, ITileUpdater2
struct winrt::Windows::UI::Notifications::TileUpdater : ITileUpdater, ITileUpdater2
public sealed class TileUpdater : ITileUpdater, ITileUpdater2
Public NotInheritable Class TileUpdater Implements ITileUpdater, ITileUpdater2
// This class does not provide a public constructor.
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 Update used to send a 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);
}

The following line of code uses EnableNotificationQueue to enable the notification queue for the calling app's tile.


Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication().enableNotificationQueue(true);

The following example shows the use of the RemoveFromSchedule method.


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

Remarks

To get an instance of this object, call the TileUpdateManager.CreateTileUpdaterForApplication or TileUpdateManager.CreateTileUpdaterForSecondaryTile method.

When it is created, TileUpdater is bound to a specific app or secondary tile, so the methods of this class affect only the single tile that the object instance is bound to.

Properties

Setting Setting Setting Setting Setting

Gets a value that specifies whether a tile can be updated through notifications.

Methods

AddToSchedule(ScheduledTileNotification) AddToSchedule(ScheduledTileNotification) AddToSchedule(ScheduledTileNotification) AddToSchedule(ScheduledTileNotification) AddToSchedule(ScheduledTileNotification)

Adds a ScheduledTileNotification to the schedule.

Clear() Clear() Clear() Clear() Clear()

Removes all updates and causes the tile to display its default content as declared in the app's manifest.

EnableNotificationQueue(Boolean) EnableNotificationQueue(Boolean) EnableNotificationQueue(Boolean) EnableNotificationQueue(Boolean) EnableNotificationQueue(Boolean)

Enables the tile to queue up to five notifications. This enables the notification queue on all tile sizes.

EnableNotificationQueueForSquare150x150(Boolean) EnableNotificationQueueForSquare150x150(Boolean) EnableNotificationQueueForSquare150x150(Boolean) EnableNotificationQueueForSquare150x150(Boolean) EnableNotificationQueueForSquare150x150(Boolean)

Enables the tile to queue up to five notifications on the medium tile.

EnableNotificationQueueForSquare310x310(Boolean) EnableNotificationQueueForSquare310x310(Boolean) EnableNotificationQueueForSquare310x310(Boolean) EnableNotificationQueueForSquare310x310(Boolean) EnableNotificationQueueForSquare310x310(Boolean)

Enables the tile to queue up to five notifications on the large tile.

EnableNotificationQueueForWide310x150(Boolean) EnableNotificationQueueForWide310x150(Boolean) EnableNotificationQueueForWide310x150(Boolean) EnableNotificationQueueForWide310x150(Boolean) EnableNotificationQueueForWide310x150(Boolean)

Enables the tile to queue up to five notifications on the wide tile.

GetScheduledTileNotifications() GetScheduledTileNotifications() GetScheduledTileNotifications() GetScheduledTileNotifications() GetScheduledTileNotifications()

Retrieves a list of scheduled updates to the tile.

RemoveFromSchedule(ScheduledTileNotification) RemoveFromSchedule(ScheduledTileNotification) RemoveFromSchedule(ScheduledTileNotification) RemoveFromSchedule(ScheduledTileNotification) RemoveFromSchedule(ScheduledTileNotification)

Removes an upcoming tile update from the schedule.

StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence)

Begins a series of timed updates for the tile that the updater is bound to. Update content is retrieved from a specified Uniform Resource Identifier (URI). Updates begin at a specified time.

StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence) StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence)

Begins a series of timed content changes for the tile that the updater is bound to, beginning immediately.

StartPeriodicUpdateBatch(IIterable<Uri>, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, DateTime, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, DateTime, PeriodicUpdateRecurrence)

Begins a series of timed updates that cycle on the tile that the updater is bound to. Update content is retrieved from an array of specified Uniform Resource Identifier (URI) with updates beginning at a specified time and subsequent updates occurring at the periodic interval thereafter.

Note

To use this feature, you must first enable the tile's notification queue by calling EnableNotificationQueue.

StartPeriodicUpdateBatch(IIterable<Uri>, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, PeriodicUpdateRecurrence) StartPeriodicUpdateBatch(IIterable<Uri>, PeriodicUpdateRecurrence)

Begins a series of timed updates that cycle on the tile that the updater is bound to. Update content is retrieved from an array of specified Uniform Resource Identifier (URI), the first update happening immediately and subsequent updates occurring at the periodic interval thereafter.

Note

To use this feature, you must first enable the tile's notification queue by calling EnableNotificationQueue.

StopPeriodicUpdate() StopPeriodicUpdate() StopPeriodicUpdate() StopPeriodicUpdate() StopPeriodicUpdate()

Cancels the current series of timed updates for the tile that the updater is bound to.

Update(TileNotification) Update(TileNotification) Update(TileNotification) Update(TileNotification) Update(TileNotification)

Applies a change in content or appearance to the tile.