CommandManager Class
TOC
Collapse the table of content
Expand the table of content

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.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

System.Object
  System.Windows.Input.CommandManager

public sealed class CommandManager

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

Attaches the specified CanExecuteRoutedEventHandler to the specified element.

System_CAPS_pubmethodSystem_CAPS_staticAddExecutedHandler(UIElement, ExecutedRoutedEventHandler)

Attaches the specified ExecutedRoutedEventHandler to the specified element.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

Attaches the specified CanExecuteRoutedEventHandler to the specified element.

System_CAPS_pubmethodSystem_CAPS_staticAddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler)

Attaches the specified ExecutedRoutedEventHandler to the specified element.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticInvalidateRequerySuggested()

Forces the CommandManager to raise the RequerySuggested event.

System_CAPS_pubmethodSystem_CAPS_staticRegisterClassCommandBinding(Type, CommandBinding)

Registers a CommandBinding with the specified type.

System_CAPS_pubmethodSystem_CAPS_staticRegisterClassInputBinding(Type, InputBinding)

Registers the specified InputBinding with the specified type.

System_CAPS_pubmethodSystem_CAPS_staticRemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

Detaches the specified CanExecuteRoutedEventHandler from the specified element.

System_CAPS_pubmethodSystem_CAPS_staticRemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler)

Detaches the specified ExecutedRoutedEventHandler from the specified element.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

Detaches the specified CanExecuteRoutedEventHandler from the specified element.

System_CAPS_pubmethodSystem_CAPS_staticRemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler)

Detaches the specified ExecutedRoutedEventHandler from the specified element.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticCanExecuteEvent

Identifies the CanExecute attached event.

System_CAPS_pubfieldSystem_CAPS_staticExecutedEvent

Identifies the Executed attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewCanExecuteEvent

Identifies the PreviewCanExecute attached event.

System_CAPS_pubfieldSystem_CAPS_staticPreviewExecutedEvent

Identifies the PreviewExecuted attached event.

NameDescription
System_CAPS_pubeventSystem_CAPS_staticRequerySuggested

Occurs when the CommandManager detects conditions that might change the ability of a command to execute.

NameDescription
System_CAPS_pubeventSystem_CAPS_staticCanExecute

Occurs when the CanExecute method on the RoutedCommand is called and the PreviewCanExecute event was not handled.

System_CAPS_pubeventSystem_CAPS_staticExecuted

Occurs when the Execute method on the RoutedCommand is called and the PreviewExecuted event was not handled.

System_CAPS_pubeventSystem_CAPS_staticPreviewCanExecute

Occurs when the CanExecute method on the RoutedCommand is called.

System_CAPS_pubeventSystem_CAPS_staticPreviewExecuted

Occurs when the Execute method on the RoutedCommand is called.

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.

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft