Ejemplo n.º 1
0
        public static void ShowToast(string description, ToastIconType type, string title = null)
        {
            var _data = new ToastData()
            {
                Title = title, Description = description, Type = type
            };

            _instance.Show(_data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shows a balloon tip/toast in the system tray.
        /// </summary>
        /// <param name="timeout">Number of miliseconds after which the tip is hidden.</param>
        /// <param name="tipTitle">Title of the balloon/toast.</param>
        /// <param name="tipText">Contents of the balloon/toast.</param>
        /// <param name="icon">Icon accompanying the popup balloon/toast.</param>
        public void ShowBalloonTip(int timeout, string tipTitle, string tipText, ToastIconType icon)
        {
            var nIconData = new Windows.Shell32Structures.NotifyIconData
            {
                Handle            = hWnd,
                UId               = uId,
                Flags             = (int)Shell32.NotifyIconFlags.NifInfo,
                Timeout           = timeout,
                InfoTitle         = tipTitle,
                Info              = tipText,
                BalloonIconHandle = toastIconHandles[icon],
                InfoFlags         = (int)Shell32.NotifyIconInfoFlags.NiifLargeIcon | (int)Shell32.NotifyIconInfoFlags.NiifUser | (int)Shell32.NotifyIconInfoFlags.NiifNoSound,
            };

            Shell32.ShellNotifyIcon(Shell32.NotifyIconMessage.NimModify, nIconData);
        }
Ejemplo n.º 3
0
 public static void Show(string content, ToastIconType iconType = ToastIconType.None, bool isUsePopup = false)
 {
     if (!string.IsNullOrEmpty(content))
     {
         DispatcherUtil.Run(() =>
         {
             try
             {
                 ToastView.ShowToast(content, iconType);
             }
             catch (Exception ex)
             {
                 System.Diagnostics.Debug.WriteLine(ex.Message);
             }
         }, Windows.UI.Core.CoreDispatcherPriority.High);
     }
 }
Ejemplo n.º 4
0
 public static void ShowToast(string content, ToastIconType iconType = ToastIconType.None, string title = null)
 {
     ToastView.ShowToast(content, iconType, title);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Show a balloon notification popup.
 /// </summary>
 /// <param name="notificationTitle">Balloon title.</param>
 /// <param name="notificationText">Text to show inside the balloon.</param>
 /// <param name="icon">Type of the icon to show.</param>
 /// <param name="timeoutMiliseconds">Timeout in miliseconds after which the balloon will be hidden.</param>
 /// <param name="clickEvent">Click event handler type when the balloon is clicked.</param>
 public void ShowNotification(string notificationTitle, string notificationText, ToastIconType icon, int timeoutMiliseconds = DefaultBalloonTipTimeout, ToastClickEvent clickEvent = ToastClickEvent.None)
 {
     notifyIcon.ShowBalloonTip(timeoutMiliseconds, notificationTitle, notificationText, icon, clickEvent);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Show a balloon notification popup.
 /// </summary>
 /// <param name="notificationTitle">Balloon title.</param>
 /// <param name="notificationText">Text to show inside the balloon.</param>
 /// <param name="icon">Type of the icon to show.</param>
 /// <param name="timeoutMiliseconds">Timeout in miliseconds after which the balloon will be hidden.</param>
 public void ShowNotification(string notificationTitle, string notificationText, ToastIconType icon, int timeoutMiliseconds = DefaultBalloonTipTimeout)
 {
     notifyIcon.ShowBalloonTip(timeoutMiliseconds, notificationTitle, notificationText, icon);
 }