user3217104
user3217104

Reputation: 21

Using a parameter with Catel Command

I tried using a parameter with Catel's Command:

public Command MyCommand { get; private set; }

MyCommand = new Command(MyCommand_Execute);

private void MyCommand_Execute(object parameter)
{
}

and get the following error:

The best overloaded method match for 'Catel.MVVM.Command.Command(System.Action, System.Func, object)' has some invalid arguments

I followed the sample Catel code, any ideas?

Upvotes: 2

Views: 1257

Answers (1)

Geert van Horrik
Geert van Horrik

Reputation: 5724

The finalize this question with an actual answer:

Use the generic implementation of the Command class, which is Command:

public Command<int> MyCommand { get; private set; }

MyCommand = new Command<int>(MyCommand_Execute);

private void MyCommand_Execute(int parameter)
{
}

Upvotes: 6

Related Questions