Files
wpf-notifyicon/Source/Sample Project/Commands/ShowMainWindowCommand.cs
Philipp Sumi f349d3d339 WPF NotifyIcon
--------------
CHG   Generally improved sample project - added more bindings, welcome balloon, changed layout.
CHG   Changed namespace in sample project. Preparing tutorials.

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

28 lines
615 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 Application.Current.MainWindow.IsVisible == false;
}
}
}