/// <summary> /// Sends out a basic Windows 8 style notification /// </summary> /// <param name="type">Icon to be shown</param> /// <param name="title">Title of Notification</param> /// <param name="message">Main message content (plaintext only)</param> public void Push(NotifcationType type, string title, string message) { Logging.WriteLine($"Notification: {type} / {title} / {message}"); var toastXml = new XmlDocument(); toastXml.LoadXml($@"<toast><visual><binding template='ToastGeneric'><text>{title}</text><text>{message}</text></binding></visual></toast>"); var toast = new ToastNotification(toastXml) { ExpirationTime = DateTimeOffset.Now.AddHours(1) }; _notifier.Show(toast); }
private Notification(NotifcationType type, string message = null, string id = null) { Type = type; Id = id; Message = message; }