mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-16 11:08:30 -05:00
FIX Adding missing sample command.
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@212 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
24
Source/Sample Project/Commands/CloseWindowCommand.cs
Normal file
24
Source/Sample Project/Commands/CloseWindowCommand.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
namespace Samples.Commands
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Closes the current window.
|
||||||
|
/// </summary>
|
||||||
|
public class CloseWindowCommand : CommandBase<CloseWindowCommand>
|
||||||
|
{
|
||||||
|
public override void Execute(object parameter)
|
||||||
|
{
|
||||||
|
GetTaskbarWindow(parameter).Close();
|
||||||
|
CommandManager.InvalidateRequerySuggested();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override bool CanExecute(object parameter)
|
||||||
|
{
|
||||||
|
Window win = GetTaskbarWindow(parameter);
|
||||||
|
return win != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user