TileNotification TileNotification TileNotification TileNotification TileNotification Class

Definition

Defines an update to a tile, including its visuals, identification tag, and expiration time.

public : sealed class TileNotification : ITileNotification
struct winrt::Windows::UI::Notifications::TileNotification : ITileNotification
public sealed class TileNotification : ITileNotification
Public NotInheritable Class TileNotification Implements ITileNotification
var tileNotification = new tileNotification(content);
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 uses the TileNotification constructor to create a new instance, then uses the ExpirationTime property to show a tile notification for 30 seconds.


function tileNotificationExpiration() {
    var Notifications = Windows.UI.Notifications;
    var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text04);

    var currentTime = new Date();
    var seconds = 30;

    var tileTextAttributes = tileXml.getElementsByTagName("text");
    tileTextAttributes[0].appendChild(tileXml.createTextNode("This notification will expire at " + new Date(currentTime.getTime() + seconds * 1000)));

    var tileNotification = new Notifications.TileNotification(tileXml);

    // Set the expiration time on the notification
    var expiryTime = new Date(currentTime.getTime() + seconds * 1000);

    tileNotification.expirationTime = expiryTime;
    Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
}

Constructors

TileNotification(XmlDocument) TileNotification(XmlDocument) TileNotification(XmlDocument) TileNotification(XmlDocument) TileNotification(XmlDocument)

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

Properties

Content Content Content Content Content

Gets the XML description of the notification content, which you can then manipulate to alter the notification.

ExpirationTime ExpirationTime ExpirationTime ExpirationTime ExpirationTime

Gets or sets the time that Windows will remove the notification from the tile. By default, a tile update does not expire. It is a best practice to explicitly set an expiration time to avoid stale content.

Tag Tag Tag Tag Tag

Gets or sets a string that Windows can use to prevent duplicate notification content from appearing in the queue.

See Also