using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping; using System; using System.Collections.Generic; using System.Text; using System.Windows.Input; namespace KanSan.ViewModel.Commands { public class RelayCommand : ICommand { private Action execute; private Func canExecute; public event EventHandler CanExecuteChanged; public RelayCommand(Action execute, Func canExecute = null) { this.execute = execute; this.canExecute = canExecute; } public bool CanExecute(object parameter) { return this.canExecute == null || this.canExecute(parameter); } public void Execute(object parameter) { this.execute(parameter); } } }