TileUpdater class

Applies to Windows and Windows Phone

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

Syntax


var tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
var tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(applicationId);
var tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileId);

Attributes

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

Members

The TileUpdater class has these types of members:

Methods

The TileUpdater class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
AddToSchedule 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 Enables the tile to queue up to five notifications. This enables the notification queue on all tile sizes.
EnableNotificationQueueForSquare150x150 Enables the tile to queue up to five notifications on the medium tile.
EnableNotificationQueueForSquare310x310 Enables the tile to queue up to five notifications on the large tile.
EnableNotificationQueueForWide310x150 Enables the tile to queue up to five notifications on the wide tile.
GetScheduledTileNotifications Retrieves a list of scheduled updates to the tile.
RemoveFromSchedule 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.
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.
StopPeriodicUpdate Cancels the current series of timed updates for the tile that the updater is bound to.
Update Applies a change in content or appearance to the tile.

 

Properties

The TileUpdater class has these properties.

PropertyAccess typeDescription

Setting

Read-onlyGets a value that specifies whether a tile can be updated through notifications.

 

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.

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

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft