Is the parameter passed to the CanExecute method of bound commands the CommandParameter specified in the binding control? If not, where does it come from?
2 Answers
Alex Curtis is right:
public bool CanExecute(object parameter)
public void Execute(object parameter)
Use both the object that was set as CommandParameter for the command.
This is also good to know when calling ICommand's OnCanExecuteChanged(EventArgs e) because this method won't let you pass any parameter. So CanExecute must use the CommandParameter previously set.
CommandParameter