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