Skip to content

Command implementations

Jesse R. Jose edited this page Jan 19, 2020 · 1 revision

Implementations

If you want to avoid boring repetitive code and move on with the fascinating part, you can use one of the generic implementations.

class MyClass
{
  public MyClass()
  {
    MyCommand = new Command<Foo>(SomethingInteresting);
  }

  public Command<Foo> MyCommand { get; }

  private void SomethingInteresting(Foo foo)
  {
    // do your thing...
  }
}

Clone this wiki locally