diff --git a/src/NotifyIconWpf.Sample.ShowCases/Commands/CloseWindowCommand.cs b/src/NotifyIconWpf.Sample.ShowCases/Commands/CloseWindowCommand.cs index 0c086ce..66c1bbb 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Commands/CloseWindowCommand.cs +++ b/src/NotifyIconWpf.Sample.ShowCases/Commands/CloseWindowCommand.cs @@ -5,6 +5,7 @@ using System.Windows; using System.Windows.Input; +using Hardcodet.Wpf.TaskbarNotification; namespace NotifyIconWpf.Sample.ShowCases.Commands { @@ -15,8 +16,12 @@ public class CloseWindowCommand : CommandBase { public override void Execute(object parameter) { - GetTaskbarWindow(parameter).Close(); - CommandManager.InvalidateRequerySuggested(); + if (parameter is TaskbarIcon taskbarIcon) + { + taskbarIcon.CloseTrayPopup(); + GetTaskbarWindow(taskbarIcon).Close(); + CommandManager.InvalidateRequerySuggested(); + } } diff --git a/src/NotifyIconWpf.Sample.ShowCases/Tutorials/03 - Popups/InlinePopupWindow.xaml b/src/NotifyIconWpf.Sample.ShowCases/Tutorials/03 - Popups/InlinePopupWindow.xaml index 5937d57..85a7729 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Tutorials/03 - Popups/InlinePopupWindow.xaml +++ b/src/NotifyIconWpf.Sample.ShowCases/Tutorials/03 - Popups/InlinePopupWindow.xaml @@ -22,8 +22,7 @@ Background="White" BorderBrush="Orange" BorderThickness="2" - CornerRadius="4" - Width="160"> + CornerRadius="4">