The action :
readonly Action _execute;
public RelayCommand(Action execute)
: this(execute, null)
{
}
public RelayCommand(Action execute, Func<Boolean> canExecute)
{
if (execute == null)
throw new ArgumentNullException("execute");
_execute = execute;
_canExecute = canExecute;
}
Other class's code:
public void CreateCommand()
{
RelayCommand command = new RelayCommand((param)=> RemoveReferenceExcecute(param));}
}
private void RemoveReferenceExcecute(object param)
{
ReferenceViewModel referenceViewModel = (ReferenceViewModel) param;
ReferenceCollection.Remove(referenceViewModel);
}
Why do I get the following exception, how can I fix it?
Delegate 'System.Action' does not take 1 arguments