Class CommandManager
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.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public sealed class CommandManager : DependencyObject
Fields
CanExecuteEvent
Identifies the CanExecute attached event.
Declaration
public static readonly RoutedEvent CanExecuteEvent
Field Value
RoutedEvent
|
CommandBindingsProperty
Identifies the CommandBindings dependency property.
Declaration
public static readonly DependencyProperty CommandBindingsProperty
Field Value
System.Windows.DependencyProperty
|
ExecutedEvent
Identifies the Executed attached event.
Declaration
public static readonly RoutedEvent ExecutedEvent
Field Value
RoutedEvent
|
InputBindingsProperty
Identifies the InputBindings dependency property.
Declaration
public static readonly DependencyProperty InputBindingsProperty
Field Value
System.Windows.DependencyProperty
|
PreviewCanExecuteEvent
Identifies the PreviewCanExecute attached event.
Declaration
public static readonly RoutedEvent PreviewCanExecuteEvent
Field Value
RoutedEvent
|
PreviewExecutedEvent
Identifies the PreviewExecuted attached event.
Declaration
public static readonly RoutedEvent PreviewExecutedEvent
Field Value
RoutedEvent
|
Methods
AddCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Attaches the specified CanExecuteRoutedEventHandler to the specified element.
Declaration
public static void AddCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
CanExecuteRoutedEventHandler
handler
The handler. |
AddExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Attaches the specified ExecutedRoutedEventHandler to the specified element.
Declaration
public static void AddExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
ExecutedRoutedEventHandler
handler
The handler. |
AddPreviewCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Attaches the specified CanExecuteRoutedEventHandler to the specified element.
Declaration
public static void AddPreviewCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
CanExecuteRoutedEventHandler
handler
The handler. |
AddPreviewExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Attaches the specified ExecutedRoutedEventHandler to the specified element.
Declaration
public static void AddPreviewExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
ExecutedRoutedEventHandler
handler
The handler. |
GetCommandBindings(DependencyObject)
Gets a collection of CommandBinding objects associated with this element. A CommandBinding enables command handling for this element, and declares the linkage between a command, its events, and the handlers attached by this element.
Declaration
public static CommandBindingCollection GetCommandBindings(DependencyObject element)
Parameters
System.Windows.DependencyObject
element
The element. |
Returns
CommandBindingCollection
|
GetInputBindings(DependencyObject)
Gets the collection of input bindings associated with this element.
Declaration
public static InputBindingCollection GetInputBindings(DependencyObject element)
Parameters
System.Windows.DependencyObject
element
The element. |
Returns
InputBindingCollection
|
InvalidateRequerySuggested()
Forces the CommandManager to raise the RequerySuggested event.
Declaration
public static void InvalidateRequerySuggested()
RegisterClassCommandBinding(Type, CommandBinding)
Registers a CommandBinding with the specified type.
Declaration
public static void RegisterClassCommandBinding(Type type, CommandBinding commandBinding)
Parameters
System.Type
type
The type. |
CommandBinding
commandBinding
The command binding. |
RegisterClassInputBinding(Type, InputBinding)
Registers the specified InputBinding with the specified type.
Declaration
public static void RegisterClassInputBinding(Type type, InputBinding inputBinding)
Parameters
System.Type
type
The type. |
InputBinding
inputBinding
The input binding. |
RemoveCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Detaches the specified CanExecuteRoutedEventHandler from the specified element.
Declaration
public static void RemoveCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
CanExecuteRoutedEventHandler
handler
The handler. |
RemoveExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Detaches the specified ExecutedRoutedEventHandler from the specified element.
Declaration
public static void RemoveExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
ExecutedRoutedEventHandler
handler
The handler. |
RemovePreviewCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Detaches the specified CanExecuteRoutedEventHandler from the specified element.
Declaration
public static void RemovePreviewCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
CanExecuteRoutedEventHandler
handler
The handler. |
RemovePreviewExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Detaches the specified ExecutedRoutedEventHandler from the specified element.
Declaration
public static void RemovePreviewExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
System.Windows.DependencyObject
element
The element. |
ExecutedRoutedEventHandler
handler
The handler. |
SetCommandBindings(DependencyObject, CommandBindingCollection)
Sets a collection of CommandBinding objects associated with this element. A CommandBinding enables command handling for this element, and declares the linkage between a command, its events, and the handlers attached by this element.
Declaration
public static void SetCommandBindings(DependencyObject element, CommandBindingCollection value)
Parameters
System.Windows.DependencyObject
element
The element. |
CommandBindingCollection
value
The value. |
SetInputBindings(DependencyObject, InputBindingCollection)
Sets the collection of input bindings associated with this element.
Declaration
public static void SetInputBindings(DependencyObject element, InputBindingCollection value)
Parameters
System.Windows.DependencyObject
element
The element. |
InputBindingCollection
value
The value. |
Events
RequerySuggested
Occurs when the CommandManager detects conditions that might change the ability of a command to execute.
Declaration
public static event EventHandler RequerySuggested
Event Type
System.EventHandler
|