ICommand ICommand ICommand ICommand Interface
Definition
Defines the contract for commanding.
.NET This interface appears as System.Windows.Input.ICommand.
public : interface ICommandpublic interface ICommandPublic Interface ICommand// This API is not available in Javascript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
When programming with .NET, this interface is hidden and developers should use the System.Windows.Input.ICommand interface.
Note
Older versions of .NET reference documentation (3.0) indicate that the System.Windows.Input.ICommand interface is defined in PresentationCore, which is a Windows Presentation Foundation (WPF) assembly. That is no longer the case, System.Windows.Input.ICommand is defined in the System.ObjectModel assembly, so you don't need to take Windows Presentation Foundation (WPF) dependencies in order to implement ICommand.
Methods
CanExecute(Object) CanExecute(Object) CanExecute(Object) CanExecute(Object)
Defines the method that determines whether the command can execute in its current state.
public : PlatForm::Boolean CanExecute(PlatForm::Object parameter)public bool CanExecute(Object parameter)Public Function CanExecute(parameter As Object) As bool// This API is not available in Javascript.
- parameter
- PlatForm::Object Object Object Object
Data used by the command. If the command does not require data to be passed, this object can be set to null.
true if this command can be executed; otherwise, false.
Execute(Object) Execute(Object) Execute(Object) Execute(Object)
Defines the method to be called when the command is invoked.
public : void Execute(PlatForm::Object parameter)public void Execute(Object parameter)Public Function Execute(parameter As Object) As void// This API is not available in Javascript.
- parameter
- PlatForm::Object Object Object Object
Data used by the command. If the command does not require data to be passed, can be set to null.
Remarks
When programming with .NET, this interface is hidden and developers should use the System.Windows.Input.ICommand interface.
Events
CanExecuteChanged CanExecuteChanged CanExecuteChanged CanExecuteChanged
Occurs when changes occur that affect whether the command should execute.
public : abstract event EventHandler CanExecuteChanged<object>public abstract event EventHandler CanExecuteChanged<object>Public MustInherit Event CanExecuteChanged<object>// This API is not available in Javascript.