This commit is contained in:
bao-qian
2016-05-23 22:09:30 +01:00
parent e1131dcf3d
commit 6e4279e30f
3 changed files with 1 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Windows.Input;
namespace Wox.ViewModel
{
public class RelayCommand : ICommand
{
private Action<object> _action;
public RelayCommand(Action<object> action)
{
_action = action;
}
public virtual bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged;
public virtual void Execute(object parameter)
{
_action?.Invoke(parameter);
}
}
}