mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 10:00:10 -05:00
* Applied some code conventions, used more current language features which should improve readability and making it easier to re-factor / modify. Also fixed some typos in documentation. * Changes based on PR conversation for the SystemInfo * Some modifications due to conversations on the PR, especially I removed the FlagsAttribute on the BalloonFlags. * Removed Silverlight targeting in code.
30 lines
755 B
C#
30 lines
755 B
C#
using System;
|
|
using System.Windows.Input;
|
|
|
|
namespace Windowless_Sample
|
|
{
|
|
/// <summary>
|
|
/// Simplistic delegate command for the demo.
|
|
/// </summary>
|
|
public class DelegateCommand : ICommand
|
|
{
|
|
public Action CommandAction { get; set; }
|
|
public Func<bool> CanExecuteFunc { get; set; }
|
|
|
|
public void Execute(object parameter)
|
|
{
|
|
CommandAction();
|
|
}
|
|
|
|
public bool CanExecute(object parameter)
|
|
{
|
|
return CanExecuteFunc == null || CanExecuteFunc();
|
|
}
|
|
|
|
public event EventHandler CanExecuteChanged
|
|
{
|
|
add { CommandManager.RequerySuggested += value; }
|
|
remove { CommandManager.RequerySuggested -= value; }
|
|
}
|
|
}
|
|
} |