/* public void sendToast(int timeAddedSec, string toastdescription, string toastTitle) * { * Debug.WriteLine("toast"); * try * { * DateTime dueTime = DateTime.Now.AddSeconds(timeAddedSec); * // Set up the notification text. * var toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02); * var strings = toastXml.GetElementsByTagName("text"); * strings[0].AppendChild(toastXml.CreateTextNode(toastTitle)); * strings[1].AppendChild(toastXml.CreateTextNode(toastdescription)); * * // Create the toast notification object. * var toast = new ScheduledToastNotification(toastXml, DateTime.Now); * var idNumber = 5; // Generates a unique ID number for the notification. * toast.Id = "Toast" + idNumber; * * // Add to the schedule. * ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast); * } * catch (Exception e) * { Debug.WriteLine("toast exception = "+e.ToString()); } * * * * * * }*/ void SendToast(string heading, string createdAt) { ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier(); XmlDocument xmlToastContent = ToastNotificationManager.GetTemplateContent( ToastTemplateType.ToastImageAndText01); TemplateUtility.CompleteTemplate( xmlToastContent, new string[] { heading }, new string[] { createdAt }, "ms-winsoundevent:Notification.Mail"); // TODO: change delivery time ScheduledToastNotification toastNotification = new ScheduledToastNotification(xmlToastContent, (new DateTimeOffset(DateTime.Now) + TimeSpan.FromSeconds(10))); // TODO: change identifier toastNotification.Id = "AirTnT"; toastNotifier.AddToSchedule(toastNotification); }