Share via


ToastNotifier.RemoveFromSchedule(ScheduledToastNotification) Method

Definition

Cancels the scheduled display of a specified ScheduledToastNotification.

Important

This method is only supported in applications which use WinRT as their default application framework.

public:
 virtual void RemoveFromSchedule(ScheduledToastNotification ^ scheduledToast) = RemoveFromSchedule;
void RemoveFromSchedule(ScheduledToastNotification const& scheduledToast);
public void RemoveFromSchedule(ScheduledToastNotification scheduledToast);
function removeFromSchedule(scheduledToast)
Public Sub RemoveFromSchedule (scheduledToast As ScheduledToastNotification)

Parameters

scheduledToast
ScheduledToastNotification

The notification to remove from the schedule.

Examples

The following example shows the use of the RemoveFromSchedule method.

var notifier = Notifications.ToastNotificationManager.createToastNotifier();
var scheduled = notifier.getScheduledToastNotifications();                    

for (var i = 0, len = scheduled.length; i < len; i++) {

    // The itemId value is the unique ScheduledTileNotification.Id assigned to the 
    // notification when it was created.
    if (scheduled[i].id === itemId) {
        notifier.removeFromSchedule(scheduled[i]);
    }
}

Remarks

If you want to cancel one or more scheduled toast notifications, you can use the GetScheduledToastNotifications method to get the full list.

Applies to