我知道怎麼做,從這個樣本 http://code.msdn.microsoft.com/windowsapps/Schedules-Toast-notificatio-457e599b#content如何刪除計劃的Toast通知
,但現在我想要做的是知道如何刪除已經創建的敬酒 我想這個計劃Toast通知 代碼但它不起作用
IReadOnlyList<ScheduledToastNotification> scheduled =
ToastNotificationManager.CreateToastNotifier().GetScheduledToastNotifications();
foreach (ScheduledToastNotification notify in scheduled)
{
if (notify.Id == id)
{
ToastNotificationManager.CreateToastNotifier().RemoveFromSchedule(notify);
}
}
此代碼有效。您是否在創建通知時設置了通知ID?您需要設置它並保存創建的通知ID的列表,以便稍後可以取消它。 – Dpedrinha 2017-04-19 07:00:42