CommandManager Class
Provides command related utility methods that register CommandBinding and InputBinding objects for class owners and commands, add and remove command event handlers, and provides services for querying the status of a command.
Assembly: PresentationCore (in PresentationCore.dll)
The CommandManager type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | AddCanExecuteHandler | Attaches the specified CanExecuteRoutedEventHandler to the specified element. |
![]() ![]() | AddExecutedHandler | Attaches the specified ExecutedRoutedEventHandler to the specified element. |
![]() ![]() | AddPreviewCanExecuteHandler | Attaches the specified CanExecuteRoutedEventHandler to the specified element. |
![]() ![]() | AddPreviewExecutedHandler | Attaches the specified ExecutedRoutedEventHandler to the specified element. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | 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.) |
![]() ![]() | InvalidateRequerySuggested | Forces the CommandManager to raise the RequerySuggested event. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | RegisterClassCommandBinding | Registers a CommandBinding with the specified type. |
![]() ![]() | RegisterClassInputBinding | Registers the specified InputBinding with the specified type. |
![]() ![]() | RemoveCanExecuteHandler | Detaches the specified CanExecuteRoutedEventHandler from the specified element. |
![]() ![]() | RemoveExecutedHandler | Detaches the specified ExecutedRoutedEventHandler from the specified element. |
![]() ![]() | RemovePreviewCanExecuteHandler | Detaches the specified CanExecuteRoutedEventHandler from the specified element. |
![]() ![]() | RemovePreviewExecutedHandler | Detaches the specified ExecutedRoutedEventHandler from the specified element. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | RequerySuggested | Occurs when the CommandManager detects conditions that might change the ability of a command to execute. |
| Name | Description | |
|---|---|---|
![]() | CanExecute | Occurs when the CanExecute method on the RoutedCommand is called and the PreviewCanExecute event was not handled. |
![]() | Executed | Occurs when the Execute method on the RoutedCommand is called and the PreviewExecuted event was not handled. |
![]() | PreviewCanExecute | Occurs when the CanExecute method on the RoutedCommand is called. |
![]() | PreviewExecuted | Occurs when the Execute method on the RoutedCommand is called. |
| Name | Description | |
|---|---|---|
![]() ![]() | CanExecuteEvent | Identifies the CanExecute attached event. |
![]() ![]() | ExecutedEvent | Identifies the Executed attached event. |
![]() ![]() | PreviewCanExecuteEvent | Identifies the PreviewCanExecute attached event. |
![]() ![]() | PreviewExecutedEvent | Identifies the PreviewExecuted attached event. |
The CommandManager is responsible for managing routed commands. For more information about commanding, see Commanding Overview.
Use RegisterClassCommandBinding to register a CommandBinding to a class as opposed to an instance.
Use RegisterClassInputBinding to register an InputBinding to a class as opposed to an instance.
The InvalidateRequerySuggested method forces the CommandManager to raise the RequerySuggested event. The RequerySuggested event informs a command source to query the command it is associated with to determine whether or not the command can execute.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
