ToolCommand Class
Acts as a command identifier and as a unified way of invoking a particular command.
Inheritance Hierarchy
System.Object
Microsoft.Windows.Design.Interaction.ToolCommand
Namespace: Microsoft.Windows.Design.Interaction
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public Class ToolCommand _
Implements ICommand
public class ToolCommand : ICommand
public ref class ToolCommand : ICommand
type ToolCommand =
class
interface ICommand
end
public class ToolCommand implements ICommand
The ToolCommand type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ToolCommand() | Initializes a new instance of the ToolCommand class. | |
ToolCommand(String) | Initializes a new instance of the ToolCommand class with the specified command name. |
Top
Properties
Name | Description | |
---|---|---|
Name | Gets the name of this command. |
Top
Methods
Name | Description | |
---|---|---|
CanExecute | Locates a command binding for the command and asks if it is enabled. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Execute | Locates a command binding for the command and executes it. | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns the name of this command. (Overrides Object.ToString().) |
Top
Events
Name | Description | |
---|---|---|
CanExecuteChanged | Occurs when the status of this command changes. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
ICommand.CanExecute | For a description of this member, see ICommand.CanExecute. | |
ICommand.Execute | For a description of this member, see ICommand.Execute. |
Top
Remarks
The ToolCommand class is similar to the RoutedCommand class in Windows Presentation Foundation (WPF). When the Execute or CanExecute method is called, the binding tree is searched for command bindings that are bound to this command. The event handlers specified by the command bindings are then executed.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Windows.Design.Interaction Namespace