Hello,
1/ for what is good the "public event EventHandler CanExecuteChanged" in my "public class RelayCommand : ICommand" ?
2/ Who is receiver/recipient of the event "RequerySuggested" ???
3/ What contains the "value" ?
Is there something like "global scheme of all such processes in A0 paper size" ?
Jerry
public class RelayCommand : ICommand
{
private Action commandTask;
public RelayCommand(Action t_workToDo)
{
commandTask = t_workToDo;
}
public event EventHandler CanExecuteChanged
{
add
{
CommandManager.RequerySuggested += value;
}
remove { CommandManager.RequerySuggested -= value; }
}
protected void OnCanExecuteChanged(Object sender, EventArgs e)
{
// this.CanExecuteChanged?.Invoke(this, new EventArgs() );
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(Object parameter)
{
commandTask();
}
}
