// Watched Detail static public void ShowWatchedToast(WhirlPoolAPIData.WATCHED w) { // Only if UI is not active if (UpdateUI != null) { return; } var title = w.TITLE_DECODED; var unread = w.UNREAD; var name = w.LAST.NAME; var id = w.ID; // arguments var lastpage = w.LASTPAGE; var lastread = w.LASTREAD; var toastXML = $@" <toast activationType='foreground' launch='{id},{lastpage},{lastread}'> <visual> <binding template='ToastGeneric'> <text>{title} ({unread})</text> <text>{name}</text> </binding> </visual> <actions> <action activationType='background' content='Mark Read' arguments='{id}'/> <action activationType='foreground' content='View' arguments='{id},{lastpage},{lastread}'/> </actions> </toast>"; var xml = new XmlDocument(); xml.LoadXml(toastXML); String text = String.Format("{0}, {1} - {2}", w.TITLE_DECODED, w.UNREAD, w.LAST.NAME); ToastNotifier tn = ToastNotificationManager.CreateToastNotifier(); ToastNotification toast = new ToastNotification(xml); toast.Tag = w.ID.ToString(); tn.Show(toast); }
static public void ClearWatchedToast(WhirlPoolAPIData.WATCHED w) { ToastNotificationManager.History.Remove(w.ID.ToString()); }