那个行动 :
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;
}
其他类的代码:
public void CreateCommand()
{
RelayCommand command = new RelayCommand((param)=> RemoveReferenceExcecute(param));}
}
private void RemoveReferenceExcecute(object param)
{
ReferenceViewModel referenceViewModel = (ReferenceViewModel) param;
ReferenceCollection.Remove(referenceViewModel);
}
为什么会出现以下异常,我该如何解决?
委托“System.Action”不接受 1 个参数