mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 17:28:29 -05:00
24 lines
608 B
C#
24 lines
608 B
C#
using System.Windows;
|
|
using System.Windows.Input;
|
|
|
|
namespace Samples.Commands
|
|
{
|
|
/// <summary>
|
|
/// Shows the main window.
|
|
/// </summary>
|
|
public class ShowSampleWindowCommand : CommandBase<ShowSampleWindowCommand>
|
|
{
|
|
public override void Execute(object parameter)
|
|
{
|
|
GetTaskbarWindow(parameter).Show();
|
|
CommandManager.InvalidateRequerySuggested();
|
|
}
|
|
|
|
|
|
public override bool CanExecute(object parameter)
|
|
{
|
|
Window win = GetTaskbarWindow(parameter);
|
|
return win != null && !win.IsVisible;
|
|
}
|
|
}
|
|
} |