From 3f5fd9284efb598c6dd694ef8c76913cc1fba72c Mon Sep 17 00:00:00 2001 From: Philipp Sumi Date: Sat, 23 Nov 2013 18:22:31 +0000 Subject: [PATCH] FIX Adding missing sample command. git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@212 9f600761-6f11-4665-b6dc-0185e9171623 --- .../Commands/CloseWindowCommand.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Source/Sample Project/Commands/CloseWindowCommand.cs diff --git a/Source/Sample Project/Commands/CloseWindowCommand.cs b/Source/Sample Project/Commands/CloseWindowCommand.cs new file mode 100644 index 0000000..2b47832 --- /dev/null +++ b/Source/Sample Project/Commands/CloseWindowCommand.cs @@ -0,0 +1,24 @@ +using System.Windows; +using System.Windows.Input; + +namespace Samples.Commands +{ + /// + /// Closes the current window. + /// + public class CloseWindowCommand : CommandBase + { + public override void Execute(object parameter) + { + GetTaskbarWindow(parameter).Close(); + CommandManager.InvalidateRequerySuggested(); + } + + + public override bool CanExecute(object parameter) + { + Window win = GetTaskbarWindow(parameter); + return win != null; + } + } +} \ No newline at end of file