mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-15 09:45:36 -05:00
WPF NotifyIcon
-------------- ADD Added ParentTaskbarIcon attached dependency property which is set for tooltips, popups, and custom balloons. CHG Made CloseBalloon public. CHG Changed sample, cleaned up commands pattern. git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@93 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
@@ -10,29 +9,19 @@ namespace Sample_Project.Commands
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class ShowMainWindowCommand : ICommand
|
||||
public class ShowMainWindowCommand : CommandBase<ShowMainWindowCommand>
|
||||
{
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
public void Execute(object parameter)
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
Application.Current.MainWindow.Show();
|
||||
TaskbarIconCommands.RefreshCommands();
|
||||
CommandManager.InvalidateRequerySuggested();
|
||||
}
|
||||
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
return Application.Current.MainWindow.IsVisible == false;
|
||||
}
|
||||
|
||||
/// <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