public ToastUi(Toast toast) { InitializeComponent(); Title.Text = toast.Title; if( toast.SubText != null) SubTitle.Text = toast.SubText; if (toast.SubSubText != null) SubSubTitle.Text = toast.SubSubText; if (! string.IsNullOrEmpty(toast.Icon)) { // Load IconSource Image.Source = new BitmapImage(new Uri(toast.Icon, UriKind.RelativeOrAbsolute)); } Loaded += ToastUi_Loaded; }
public XmlDocument FormatXml(Toast toast) { // Get a toast XML template var toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText04); SetText(toastXml, toast.Title, toast.SubText, toast.SubSubText); SetImagePath(toastXml, toast.Icon); return toastXml; }
public void Notify(Toast toast) { if( _notifier == null ) _notifier = ToastNotificationManager.CreateToastNotifier(_appId); var toastNotification = new ToastNotification(FormatXml(toast)); if (toast.OnActivated != null) { toastNotification.Activated += (s, e) => toast.OnActivated(); } _notifier.Show(toastNotification); }
public void Notify(Toast toast) { var toastUi = new ToastUi(toast); if (toast.OnActivated != null) { toastUi.Activated += (s, e) => toast.OnActivated(); } _taskbar.ShowCustomBalloon(toastUi, PopupAnimation.Slide, 4000); }