Files
wpf-notifyicon/Source/Sample Project/Commands/ShowMainWindowCommand.cs
Philipp Sumi 97ef369a02 WPF NotifyIcon
--------------
FIX   Removed debug output in WindowMessageSink.
CHG   Major rework on sample project.

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@104 9f600761-6f11-4665-b6dc-0185e9171623
2009-05-15 09:51:55 +00:00

28 lines
632 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Input;
namespace Samples.Commands
{
/// <summary>
/// Shows the main window.
/// </summary>
public class ShowMainWindowCommand : CommandBase<ShowMainWindowCommand>
{
public override void Execute(object parameter)
{
Application.Current.MainWindow.Show();
CommandManager.InvalidateRequerySuggested();
}
public override bool CanExecute(object parameter)
{
return !IsDesignMode && Application.Current.MainWindow.IsVisible == false;
}
}
}