Fixed Systray NotifyPropertyChanged, shortcut setting window
This commit is contained in:
27
Views/DelegateCommand.cs
Normal file
27
Views/DelegateCommand.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace unison
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user