2 out of 7 rated this helpful - Rate this topic

ScheduledTileNotification.ScheduledTileNotification constructor

Creates and initializes a new instance of the ScheduledTileNotification object for use with a TileUpdater.

Syntax


var scheduledTileNotification = new Windows.UI.Notifications.ScheduledTileNotification(content, deliveryTime);

Parameters

content

Type: XmlDocument

The object that provides the content for the tile notification.

deliveryTime

Type: Date [JavaScript] | System.DateTimeOffset [.NET] | Windows::Foundation::DateTime [C++]

The time at which the tile should be updated with the notification information.

Examples

The following example, which shows a tile scheduled to display in one hour, includes the use of the ScheduledTileNotification constructor to create the notification object.



var Notifications = Windows.UI.Notifications;
var currentTime = new Date();
var seconds = 60;
var dueTime = new Date(currentTime.getTime() + seconds * 60 * 1000);
var idNumber = 123456789;

var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideText09);

// Set up the wide tile text.
var tileTextAttributes = tileXml.getElementsByTagName("text");
tileTextAttributes[0].appendChild(tileXml.createTextNode("This is a scheduled notification"));
tileTextAttributes[1].appendChild(tileXml.createTextNode("Received: " + dueTime.toLocaleTimeString()));

// Set up the square tile text.
var squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquareText04);
var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("This is a scheduled notification"));

// Include the square tile in the notification.
var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
tileXml.getElementsByTagName("visual").item(0).appendChild(node);

// Create the notification object.
var futureTile = new Notifications.ScheduledTileNotification(tileXml, dueTime);
futureTile.id = "Tile" + idNumber;

// Add to the schedule.
Notifications.TileUpdateManager.createTileUpdaterForApplication().addToSchedule(futureTile);

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Namespace

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

Metadata

Windows.winmd

See also

ScheduledTileNotification
Tile schema
Scheduled notifications sample
Guidelines and checklist for scheduled notifications

 

 

Build date: 12/4/2012

© 2013 Microsoft. All rights reserved.