ScheduledToastNotification class
Contains the XML that defines the toast notification that will display at the scheduled time.
Syntax
var scheduledToastNotification = new Windows.UI.Notifications.ScheduledToastNotification(xmlDocument, dateTime); var scheduledToastNotification = new Windows.UI.Notifications.ScheduledToastNotification(xmlDocument, dateTime, timeSpan, uInt32);
Attributes
- ActivatableAttribute(Windows.UI.Notifications.IScheduledToastNotificationFactory, NTDDI_WIN8)
- ThreadingAttribute(MTA)
- VersionAttribute(NTDDI_WIN8)
Members
The ScheduledToastNotification class has these types of members:
Constructors
The ScheduledToastNotification class has these constructors.
| Constructor | Description |
|---|---|
| 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. |
Methods
The ScheduledToastNotification class inherits methods from the Object class (C#/VB/C++).
Properties
The ScheduledToastNotification class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the XML that defines this scheduled toast notification. | |
| Read-only | Gets the time that this toast notification is scheduled to be displayed. | |
| Read/write | Gets a developer-specified value used to identify a specific scheduled toast. | |
| Read-only | Gets the maximum number of times to display this notification. | |
| Read-only | Gets the amount of time between occurrences of the notification. |
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
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012
