Defines the contract for commanding.
.NET: This interface appears as System.Windows.Input.ICommand.
Syntax
public interface class ICommand
Attributes
- GuidAttribute("e5af3542-ca67-4081-995b-709dd13792df")
- VersionAttribute(NTDDI_WIN8)
- WebHostHiddenAttribute()
Members
The ICommand interface inherits from the IUnknown interface. ICommand also has these types of members:
Events
The ICommand interface has these events.
| Event | Description |
|---|---|
| CanExecuteChanged | Occurs when changes occur that affect whether the command should execute. |
Methods
The ICommand interface has these methods. It also inherits methods from the Object class.
| Method | Description |
|---|---|
| CanExecute | Defines the method that determines whether the command can execute in its current state. |
| Execute | Defines the method to be called when the command is invoked. |
Remarks
When building Windows Store apps with the Microsoft .NET Framework, this interface is hidden and developers should use the System.Windows.Input.ICommand interface.
Note Older versions of Microsoft .NET Framework reference documentation 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 WPF dependencies in order to implement ICommand.
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
Windows::UI::Xaml::Input |
|
Metadata |
|
Build date: 12/4/2012