ScheduledToastNotification ScheduledToastNotification ScheduledToastNotification ScheduledToastNotification ScheduledToastNotification Class

Definition

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

public : sealed class ScheduledToastNotification : IScheduledToastNotification, IScheduledToastNotification2, IScheduledToastNotification3
struct winrt::Windows::UI::Notifications::ScheduledToastNotification : IScheduledToastNotification, IScheduledToastNotification2, IScheduledToastNotification3
public sealed class ScheduledToastNotification : IScheduledToastNotification, IScheduledToastNotification2, IScheduledToastNotification3
Public NotInheritable Class ScheduledToastNotification Implements IScheduledToastNotification, IScheduledToastNotification2, IScheduledToastNotification3
var scheduledToastNotification = new scheduledToastNotification(content, deliveryTime);
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 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);

Remarks

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

Constructors

ScheduledToastNotification(XmlDocument, DateTime) ScheduledToastNotification(XmlDocument, DateTime) ScheduledToastNotification(XmlDocument, DateTime) ScheduledToastNotification(XmlDocument, DateTime) ScheduledToastNotification(XmlDocument, DateTime)

Creates and initializes a new instance of a ScheduledToastNotification that will be displayed only once.

ScheduledToastNotification(XmlDocument, DateTime, TimeSpan, UInt32) ScheduledToastNotification(XmlDocument, DateTime, TimeSpan, UInt32) ScheduledToastNotification(XmlDocument, DateTime, TimeSpan, UInt32) ScheduledToastNotification(XmlDocument, DateTime, TimeSpan, UInt32) ScheduledToastNotification(XmlDocument, DateTime, TimeSpan, UInt32)

Deprecated in Windows 10. On Windows 8 systems, creates and initializes a new instance of a ScheduledToastNotification that re-appears after a specified time after initially appearing. On Windows 10, this functions equivalently to ScheduledToastNotification(XmlDocument, DateTime). To achieve the same snooze interval behavior in Windows 10, you can use buttons on your toasts.

Properties

Content Content Content Content Content

Gets the XML that defines this scheduled toast notification.

DeliveryTime DeliveryTime DeliveryTime DeliveryTime DeliveryTime

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

ExpirationTime ExpirationTime ExpirationTime ExpirationTime ExpirationTime

Gets or sets the expiration time of the notification.

Group Group Group Group Group

Gets or sets the group identifier for the notification.

Id Id Id Id Id

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

MaximumSnoozeCount MaximumSnoozeCount MaximumSnoozeCount MaximumSnoozeCount MaximumSnoozeCount

Gets the maximum number of times to display this notification.

NotificationMirroring NotificationMirroring NotificationMirroring NotificationMirroring NotificationMirroring

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

RemoteId RemoteId RemoteId RemoteId RemoteId

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 SnoozeInterval SnoozeInterval SnoozeInterval SnoozeInterval

Gets the amount of time between occurrences of the notification.

SuppressPopup SuppressPopup SuppressPopup SuppressPopup SuppressPopup

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

Do not set this property to true in a toast sent to a Windows 8.x device. Doing so will cause a compiler error or a dropped notification.

Tag Tag Tag Tag Tag

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

See Also