ClassCommandManager
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.
Definition
Namespace:Telerik.UI.Xaml.Controls
Assembly:Telerik.WinUI.Controls.dll
Syntax:
public sealed class CommandManager : DependencyObject
Inheritance: objectCommandManager
Fields
CanExecuteEvent
Identifies the CanExecute attached event.
Declaration
public static readonly RoutedEvent CanExecuteEvent
Field Value
CommandBindingsProperty
Identifies the CommandBindings dependency property.
Declaration
public static readonly DependencyProperty CommandBindingsProperty
Field Value
DependencyProperty
ExecutedEvent
Identifies the Executed attached event.
Declaration
public static readonly RoutedEvent ExecutedEvent
Field Value
InputBindingsProperty
Identifies the InputBindings dependency property.
Declaration
public static readonly DependencyProperty InputBindingsProperty
Field Value
DependencyProperty
PreviewCanExecuteEvent
Identifies the PreviewCanExecute attached event.
Declaration
public static readonly RoutedEvent PreviewCanExecuteEvent
Field Value
PreviewExecutedEvent
Identifies the PreviewExecuted attached event.
Declaration
public static readonly RoutedEvent PreviewExecutedEvent
Field Value
Methods
AddCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Attaches the specified CanExecuteRoutedEventHandler to the specified element.
Declaration
public static void AddCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
handler
The handler.
AddExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Attaches the specified ExecutedRoutedEventHandler to the specified element.
Declaration
public static void AddExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
handler
The handler.
AddPreviewCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Attaches the specified CanExecuteRoutedEventHandler to the specified element.
Declaration
public static void AddPreviewCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
handler
The handler.
AddPreviewExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Attaches the specified ExecutedRoutedEventHandler to the specified element.
Declaration
public static void AddPreviewExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
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
element
DependencyObject
The element.
Returns
GetInputBindings(DependencyObject)
Gets the collection of input bindings associated with this element.
Declaration
public static InputBindingCollection GetInputBindings(DependencyObject element)
Parameters
element
DependencyObject
The element.
Returns
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
type
The type.
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
type
The type.
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
element
DependencyObject
The element.
handler
The handler.
RemoveExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Detaches the specified ExecutedRoutedEventHandler from the specified element.
Declaration
public static void RemoveExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
handler
The handler.
RemovePreviewCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)
Detaches the specified CanExecuteRoutedEventHandler from the specified element.
Declaration
public static void RemovePreviewCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
handler
The handler.
RemovePreviewExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)
Detaches the specified ExecutedRoutedEventHandler from the specified element.
Declaration
public static void RemovePreviewExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)
Parameters
element
DependencyObject
The element.
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
element
DependencyObject
The element.
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
element
DependencyObject
The element.
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 Value