Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created October 23, 2019 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/511dba19ad3c6b165bd813a2cf61b0fd to your computer and use it in GitHub Desktop.
Save IntegerMan/511dba19ad3c6b165bd813a2cf61b0fd to your computer and use it in GitHub Desktop.
public class ActionCommand : ICommand
{
private readonly Action _invokedAction;
public ActionCommand(Action invokedAction)
{
_invokedAction = invokedAction;
}
public bool CanExecute(object parameter) => true;
public void Execute(object parameter) => _invokedAction?.Invoke();
public event EventHandler CanExecuteChanged;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment