From 8e66491e09af0d033efe0d74cd7d3f613284724f Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Sun, 10 May 2026 14:05:28 -0400 Subject: [PATCH] Add manual X close to toast notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Toast was auto-dismiss-only (3s timer). Operators running a live show want to clear visual clutter without waiting — added a small X button to the right of the message that calls ToastViewModel.DismissCommand (stops timer + hides immediately). Implementation: ToastViewModel gained a DismissCommand RelayCommand and a Hide() helper. MainWindow toast overlay gained a 20x20 button bound to the command, custom inline template (rounded transparent bg, hover lifts to Wd.Button.HoverBg). --- src/TeamsISO.App/MainWindow.xaml | 36 +++++++++++++++++-- src/TeamsISO.App/ViewModels/ToastViewModel.cs | 16 +++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/TeamsISO.App/MainWindow.xaml b/src/TeamsISO.App/MainWindow.xaml index 40d006c..734d602 100644 --- a/src/TeamsISO.App/MainWindow.xaml +++ b/src/TeamsISO.App/MainWindow.xaml @@ -997,7 +997,9 @@ - + + diff --git a/src/TeamsISO.App/ViewModels/ToastViewModel.cs b/src/TeamsISO.App/ViewModels/ToastViewModel.cs index e2e874a..cbca32d 100644 --- a/src/TeamsISO.App/ViewModels/ToastViewModel.cs +++ b/src/TeamsISO.App/ViewModels/ToastViewModel.cs @@ -1,3 +1,4 @@ +using System.Windows.Input; using System.Windows.Threading; namespace TeamsISO.App.ViewModels; @@ -27,6 +28,21 @@ public sealed class ToastViewModel : ObservableObject _hideTimer.Stop(); IsVisible = false; }; + DismissCommand = new RelayCommand(Hide); + } + + /// + /// Manual dismiss. Stops the auto-hide timer and hides the toast + /// immediately. Bound to the X close button on the toast overlay so an + /// operator running a live show can clear visual clutter without waiting + /// 3 seconds. + /// + public ICommand DismissCommand { get; } + + private void Hide() + { + _hideTimer.Stop(); + IsVisible = false; } public string Message