Share via


TileUpdater Class

Definition

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

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
Inheritance
Object Platform::Object IInspectable TileUpdater
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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

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

Methods

AddToSchedule(ScheduledTileNotification)

Adds a ScheduledTileNotification to the schedule.

Clear()

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

EnableNotificationQueue(Boolean)

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

EnableNotificationQueueForSquare150x150(Boolean)

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

EnableNotificationQueueForSquare310x310(Boolean)

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

EnableNotificationQueueForWide310x150(Boolean)

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

GetScheduledTileNotifications()

Retrieves a list of scheduled updates to the tile.

RemoveFromSchedule(ScheduledTileNotification)

Removes an upcoming tile update from the schedule.

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)

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

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)

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

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

Update(TileNotification)

Applies a change in content or appearance to the tile.

Applies to