public static INotificationMessage Alert(string message, UINotificationType type = UINotificationType.None, Action closeAction = null)
 {
     return(Default()
            .HasMessage(message)
            .Dismiss().WithButton("Close", button => { closeAction?.Invoke(); })
            .WithBadgeType(type)
            .Queue());
 }
 public static INotificationMessage Alert(string message, UINotificationType type = UINotificationType.None, Action closeAction = null)
 {
     return(Application.Current.Dispatcher.Invoke(() =>
     {
         return Default()
         .HasMessage(message)
         .Dismiss().WithButton("Close", button => { closeAction?.Invoke(); })
         .WithBadgeType(type)
         .Queue();
     }, DispatcherPriority.Normal));
 }
    public void queueNotification(
        string title,
        string description,
        double score,
        UINotificationType notificationType)
    {
        UINotificationItem notification = new UINotificationItem();

        notification.title            = title;
        notification.description      = description;
        notification.notificationType = notificationType;
        notification.score            = score.ToString("N0");
        QueueNotification(notification);
    }
        public void ShowAlert(string message, string title = null, UINotificationType type = UINotificationType.None)
        {
            if (!NotificationTypeToMessageBoxImage.TryGetValue(type, out var image))
            {
                image = MessageBoxImage.None;
            }

            MessageBox.Show(
                message,
                string.IsNullOrEmpty(title) ? AppConstants.Application.DisplayName : title,
                MessageBoxButton.OK,
                image
                );
        }
    // NOTIFICATION

    public static void QueueNotification(
        string title,
        string description,
        double score,
        UINotificationType notificationType)
    {
        if (Instance != null)
        {
            Instance.queueNotification(
                title,
                description,
                score,
                notificationType);
        }
    }
    public void ShowNotificationContainerType(UINotificationType type)
    {
        if (type == UINotificationType.Achievement)
        {
            GameObjectHelper.ShowObject(notificationContainerAchievement);
        }
        else
        {
            GameObjectHelper.HideObject(notificationContainerAchievement);
        }

        if (type == UINotificationType.Point)
        {
            GameObjectHelper.ShowObject(notificationContainerPoint);
        }
        else
        {
            GameObjectHelper.HideObject(notificationContainerPoint);
        }

        if (type == UINotificationType.Error)
        {
            GameObjectHelper.ShowObject(notificationContainerError);
        }
        else
        {
            GameObjectHelper.HideObject(notificationContainerError);
        }

        if (type == UINotificationType.Tip)
        {
            GameObjectHelper.ShowObject(notificationContainerTip);
        }
        else
        {
            GameObjectHelper.HideObject(notificationContainerTip);
        }

        if (type == UINotificationType.Info)
        {
            GameObjectHelper.ShowObject(notificationContainerInfo);
        }
        else
        {
            GameObjectHelper.HideObject(notificationContainerInfo);
        }
    }
        public static NotificationMessageBuilder WithBadgeType(this NotificationMessageBuilder builder, UINotificationType type)
        {
            switch (type)
            {
            case UINotificationType.Info:
                builder.SetBadge("Info");
                builder.Message.BadgeAccentBrush =
                    new SolidColorBrush(Color.FromRgb(2, 160, 229));
                break;

            case UINotificationType.Warning:
                builder.SetBadge("Warn");
                builder.Message.BadgeAccentBrush =
                    new SolidColorBrush(Color.FromRgb(224, 160, 48));
                break;

            case UINotificationType.Error:
                builder.SetBadge("Error");
                builder.Message.BadgeAccentBrush =
                    new SolidColorBrush(Color.FromRgb(232, 13, 0));
                break;
            }

            return(builder);
        }