Reputation: 11
I knew how to do scheduled toast notification from this sample http://code.msdn.microsoft.com/windowsapps/Schedules-Toast-notificatio-457e599b#content
but now what I want to do is knowing how to remove the toast that has been created I tried this code but it's not working
IReadOnlyList<ScheduledToastNotification> scheduled =
ToastNotificationManager.CreateToastNotifier().GetScheduledToastNotifications();
foreach (ScheduledToastNotification notify in scheduled)
{
if (notify.Id == id)
{
ToastNotificationManager.CreateToastNotifier().RemoveFromSchedule(notify);
}
}
Upvotes: 1
Views: 3636
Reputation: 79
From the Microsoft example, the problem is that you're creating more than one toast notifier. Instead, you should use the same toast notifier to remove your scheduled notifications.
Upvotes: 0
Reputation: 352
You can remove scheduled tile notifications by using the Clear method. See detail at How to reset the TileUpdateManager from all scheduled tile notifications?
Upvotes: 1