wabbajack/Wabbajack/LambdaCommand.cs
Timothy Baldridge 12a6b12a65 Tons of GUI work
2019-07-30 21:59:19 -06:00

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();
}
}
}