Метод ниже выполняется при вызове набора Toast, но не отображает Toast по истечении времени. Требуются ли какие-либо дополнительные настройки для всплывающего уведомления приложения Windows 8 Metro?
int scheduledToastCounter = 1;
public void Set_Future_Toast()
{
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
stringElements.Item(0).AppendChild(toastXml.CreateTextNode("Scheduled Toast"));
DateTimeOffset displayTime = DateTimeOffset.UtcNow.AddSeconds(3);
ScheduledToastNotification scheduledToast = new ScheduledToastNotification(toastXml, displayTime);
scheduledToast.Id = "Future_" + this.scheduledToastCounter++;
ToastNotifier notifier = ToastNotificationManager.CreateToastNotifier();
notifier.AddToSchedule(scheduledToast);
int scheduledToastCount = notifier.GetScheduledToastNotifications().Count;
}
}
catch
? Кроме сокрытия ошибок. - person Cody Gray   schedule 02.02.2012