Command.CanExecute(Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个 System.Boolean,指示是否能使用给定的参数执行命令。
public bool CanExecute(object parameter);
abstract member CanExecute : obj -> bool
override this.CanExecute : obj -> bool
参数
- parameter
- System.Object
用作参数的 System.Object用于确定是否能执行命令。
返回
System.Boolean
如果能够执行命令,则为 true;否则为 false。
实现
System.Windows.Input.ICommand.CanExecute(System.Object)
注解
如果未将 canExecute 参数传递给 Command 构造函数,则此方法始终返回 true。
如果命令是使用非泛型执行参数创建的,则此方法的参数将被忽略。