Command.CanExecute(Object) 方法

定义

返回一个 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

如果命令是使用非泛型执行参数创建的,则此方法的参数将被忽略。

适用于