public void CreateToastWithExtensions_Click(object sender, RoutedEventArgs e) { IToastText04 toastContent = ToastContentFactory.CreateToastText04(); toastContent.TextHeading.Text = "This is my XML Header"; toastContent.TextBody1.Text = "Line 1"; toastContent.TextBody2.Text = "Line 2"; toastContent.Launch = "Activated from Toast"; ToastNotification toast = toastContent.CreateNotification(); //This is for apps that are already running toast.Activated += toast_Activated; ToastNotifier notifier = ToastNotificationManager.CreateToastNotifier(); notifier.Show(toast); ExtensionBasedXML.Text = XDocument.Parse(toastContent.GetContent()).ToString(); }
/// <summary> /// Displays the specified email as a toast notification. /// </summary> /// <param name="from">The from address.</param> /// <param name="subject">The subject.</param> /// <param name="body">The body.</param> /// <param name="context">The context.</param> public static void Show(string from, string subject, string body, string context) { try { // Set the subject and content _notification.Launch = context; _notification.TextHeading.Text = from; _notification.TextBody1.Text = subject; _notification.TextBody2.Text = IOUtil.TrimBody(body); // Show the notification ToastNotification toast = _notification.CreateNotification(); _toastNotifier.Show(toast); } catch (Exception ex) { LogFile.Instance.LogError("", "", ex.ToString()); } }