mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
29 lines
606 B
C#
29 lines
606 B
C#
using System;
|
|
using System.Windows.Input;
|
|
|
|
namespace Wabbajack
|
|
{
|
|
internal class LambdaCommand : ICommand
|
|
{
|
|
private Action _execute;
|
|
private Func<bool> _canExecute;
|
|
|
|
public event EventHandler CanExecuteChanged;
|
|
|
|
public LambdaCommand(Func<bool> canExecute, Action execute)
|
|
{
|
|
_execute = execute;
|
|
_canExecute = canExecute;
|
|
}
|
|
|
|
public bool CanExecute(object parameter)
|
|
{
|
|
return _canExecute();
|
|
}
|
|
|
|
public void Execute(object parameter)
|
|
{
|
|
_execute();
|
|
}
|
|
}
|
|
} |