using System; using System.Windows.Input; namespace Wabbajack { internal class LambdaCommand : ICommand { private Action _execute; private Func _canExecute; public event EventHandler CanExecuteChanged; public LambdaCommand(Func canExecute, Action execute) { _execute = execute; _canExecute = canExecute; } public bool CanExecute(object parameter) { return _canExecute(); } public void Execute(object parameter) { _execute(); } } }