ScheduledToastNotification class
TOC
Collapse the table of content
Expand the table of content

ScheduledToastNotification class

Contains the XML that defines the toast notification that will display at the scheduled time.

Syntax


public sealed class ScheduledToastNotification

Members

The ScheduledToastNotification class has these types of members:

Constructors

The ScheduledToastNotification class has these constructors.

ConstructorDescription
ScheduledToastNotification(XmlDocument,DateTime) Creates and initializes a new instance of a ScheduledToastNotification that will be displayed only once.
ScheduledToastNotification(XmlDocument,DateTime,TimeSpan,UInt32) Creates and initializes a new instance of a recurring ScheduledToastNotification.

 

Properties

The ScheduledToastNotification class has these properties.

PropertyAccess typeDescription

Content

Read-only

Gets the XML that defines this scheduled toast notification.

DeliveryTime

Read-only

Gets the time that this toast notification is scheduled to be displayed.

Group

Read/write

Gets or sets the group identifier for the notification.

Id

Read/write

Gets a developer-specified value used to identify a specific scheduled toast.

MaximumSnoozeCount

Read-only

Gets the maximum number of times to display this notification.

NotificationMirroring

Read/write

Gets or sets a value that specifies whether notification mirroring is enabled. (Notification mirroring enables a notification to appear on multiple devices.)

RemoteId

Read/write

Gets or sets a remote id for the notification that enables the system to correlate this notification with another one generated on another device.

SnoozeInterval

Read-only

Gets the amount of time between occurrences of the notification.

SuppressPopup

Read/write

Gets or sets whether a toast's pop-up UI is displayed on the user's screen.

Tag

Read/write

Gets or sets a string that uniquely identifies a toast notification inside a Group.

 

Remarks

Create and initialize a new instance of this object by calling ScheduledToastNotification.

Examples

The following example shows a toast notification scheduled to display in one hour.



var Notifications = Windows.UI.Notifications;
var currentTime = new Date();
var seconds = 60;
var dueTime = new Date(currentTime.getTime() + seconds * 60 * 1000);
var idNumber = Math.floor(Math.random() * 100000000);  // Generates a unique ID number for the notification.

// Set up the notification text.
var toastXml = Notifications.ToastNotificationManager.getTemplateContent(Notifications.ToastTemplateType.toastText02);
var strings = toastXml.getElementsByTagName("text");
strings[0].appendChild(toastXml.createTextNode(This is a scheduled toast notification));
strings[1].appendChild(toastXml.createTextNode("Received: " + dueTime.toLocaleTimeString()));

// Create the toast notification object.
var toast = new Notifications.ScheduledToastNotification(toastXml, dueTime);
toast.id = "Toast" + idNumber;

// Add to the schedule.
Notifications.ToastNotificationManager.createToastNotifier().addToSchedule(toast);

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

[Threading(MTA)]
[Version(0x06020000)]

See also

Object
Scheduled notifications sample
Toast schema
Guidelines and checklist for scheduled notifications

 

 

Show:
© 2016 Microsoft