ICommand.CanExecute(Object) ICommand.CanExecute(Object) ICommand.CanExecute(Object) ICommand.CanExecute(Object) Method

定义

定义方法,该方法确定此命令能否在其当前状态下执行。Defines the method that determines whether the command can execute in its current state.

public:
 bool CanExecute(System::Object ^ parameter);
public bool CanExecute (object parameter);
abstract member CanExecute : obj -> bool
Public Function CanExecute (parameter As Object) As Boolean

参数

parameter
Object Object Object Object

此命令使用的数据。Data used by the command. 如果此命令不需要传递数据,则该对象可以设置为 nullIf the command does not require data to be passed, this object can be set to null.

返回

如果可以执行此命令,则为 true;否则为 falsetrue if this command can be executed; otherwise, false.

注解

通常情况下,命令源调用CanExecute方法时CanExecuteChanged引发事件。Typically, a command source calls the CanExecute method when the CanExecuteChanged event is raised.

适用于

另请参阅