WPF命令绑定:CanExecute参数

WPF命令绑定:CanExecute参数,wpf,binding,Wpf,Binding,传递给绑定命令的CanExecute方法的参数是否为绑定控件中指定的CommandParameter?如果不是,它从哪里来?命令参数将被发送到执行和执行(d)事件。Alex Curtis是正确的: public bool CanExecute(object parameter) public void Execute(object parameter) 使用设置为命令的CommandParameter的对象 在调用ICommand的OnCanExecuteChanged(EventArgs e

传递给绑定命令的CanExecute方法的参数是否为绑定控件中指定的CommandParameter?如果不是,它从哪里来?

命令参数将被发送到
执行
执行(d)
事件。

Alex Curtis是正确的:

public bool CanExecute(object parameter)
public void Execute(object parameter)
使用设置为命令的
CommandParameter
的对象


在调用ICommand的
OnCanExecuteChanged(EventArgs e)
时,最好了解这一点,因为此方法不允许传递任何参数。因此CanExecute必须使用之前设置的CommandParameter。

是,它是
CommandParameter