Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }