mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-17 01:35:40 -05:00
NotifyWPF
--------- CHG Lot of plumbing, some fixes CHG Work on sample project. CHG Popups and ContextMenu now store coordinates - otherwise delayed opending may happen elsewhere. git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@55 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
39
Source/Sample Project/Commands/HideMainWindowCommand.cs
Normal file
39
Source/Sample Project/Commands/HideMainWindowCommand.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Sample_Project.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Hides the main window.
|
||||
/// </summary>
|
||||
public class HideMainWindowCommand : ICommand
|
||||
{
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
Application.Current.MainWindow.Hide();
|
||||
TaskbarIconCommands.RefreshCommands();
|
||||
}
|
||||
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return Application.Current.MainWindow.IsVisible;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Raises the <see cref="CanExecuteChanged"/> event.
|
||||
/// </summary>
|
||||
internal void RaiseCanExcecuteChanged()
|
||||
{
|
||||
if (CanExecuteChanged != null) CanExecuteChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user