namespace ytLive.Services; /// How urgent a user-facing notification is. Drives the toast's tint and lifetime. public enum AppNotificationSeverity { Info, Success, Warning, Error, } /// /// Non-blocking user-facing messages (toasts). VMs and services raise events through /// this seam so failures surface without MessageBox calls blocking the UI thread. /// public interface INotificationService { void Show(string title, string message, AppNotificationSeverity severity); } public static class NotificationServiceExtensions { public static void Info(this INotificationService service, string title, string message = "") => service.Show(title, message, AppNotificationSeverity.Info); public static void Success(this INotificationService service, string title, string message = "") => service.Show(title, message, AppNotificationSeverity.Success); public static void Warning(this INotificationService service, string title, string message = "") => service.Show(title, message, AppNotificationSeverity.Warning); public static void Error(this INotificationService service, string title, string message = "") => service.Show(title, message, AppNotificationSeverity.Error); }