using System; using System.Windows.Input; namespace IntegrationTestApp; internal class DelegateCommand : ICommand { private readonly Action _action; private readonly Func _canExecute; public DelegateCommand(Action action, Func? canExecute = default) { _action = action; _canExecute = canExecute ?? new(_ => true); } public event EventHandler? CanExecuteChanged { add { } remove { } } public bool CanExecute(object? parameter) => _canExecute(parameter); public void Execute(object? parameter) => _action(); }