using System.Threading.Tasks; using Avalonia; using Avalonia.Controls.Notifications; using StabilityMatrix.Core.Models; namespace StabilityMatrix.Avalonia.Services; public interface INotificationService { public void Initialize( Visual? visual, NotificationPosition position = NotificationPosition.BottomRight, int maxItems = 3); public void Show(INotification notification); /// /// Attempt to run the given task, showing a generic error notification if it fails. /// /// The task to run. /// The title to show in the notification. /// The message to show, default to exception.Message /// The appearance of the notification. Task> TryAsync( Task task, string title = "Error", string? message = null, NotificationType appearance = NotificationType.Error); /// /// Attempt to run the given void task, showing a generic error notification if it fails. /// Return a TaskResult with true if the task succeeded, false if it failed. /// /// The task to run. /// The title to show in the notification. /// The message to show, default to exception.Message /// The appearance of the notification. Task> TryAsync( Task task, string title = "Error", string? message = null, NotificationType appearance = NotificationType.Error); }