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.

Definition

Namespace:Telerik.UI.Xaml.Controls

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public sealed class CommandManager : DependencyObject

Inheritance: objectCommandManager

Fields

CanExecuteEvent

Identifies the CanExecute attached event.

Declaration

cs-api-definition
public static readonly RoutedEvent CanExecuteEvent

Field Value

RoutedEvent

CommandBindingsProperty

Identifies the CommandBindings dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandBindingsProperty

Field Value

DependencyProperty

ExecutedEvent

Identifies the Executed attached event.

Declaration

cs-api-definition
public static readonly RoutedEvent ExecutedEvent

Field Value

RoutedEvent

InputBindingsProperty

Identifies the InputBindings dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty InputBindingsProperty

Field Value

DependencyProperty

PreviewCanExecuteEvent

Identifies the PreviewCanExecute attached event.

Declaration

cs-api-definition
public static readonly RoutedEvent PreviewCanExecuteEvent

Field Value

RoutedEvent

PreviewExecutedEvent

Identifies the PreviewExecuted attached event.

Declaration

cs-api-definition
public static readonly RoutedEvent PreviewExecutedEvent

Field Value

RoutedEvent

Methods

AddCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)

Attaches the specified CanExecuteRoutedEventHandler to the specified element.

Declaration

cs-api-definition
public static void AddCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

CanExecuteRoutedEventHandler

The handler.

AddExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)

Attaches the specified ExecutedRoutedEventHandler to the specified element.

Declaration

cs-api-definition
public static void AddExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

ExecutedRoutedEventHandler

The handler.

AddPreviewCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)

Attaches the specified CanExecuteRoutedEventHandler to the specified element.

Declaration

cs-api-definition
public static void AddPreviewCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

CanExecuteRoutedEventHandler

The handler.

AddPreviewExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)

Attaches the specified ExecutedRoutedEventHandler to the specified element.

Declaration

cs-api-definition
public static void AddPreviewExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

ExecutedRoutedEventHandler

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

cs-api-definition
public static CommandBindingCollection GetCommandBindings(DependencyObject element)

Parameters

element

DependencyObject

The element.

Returns

CommandBindingCollection

GetInputBindings(DependencyObject)

Gets the collection of input bindings associated with this element.

Declaration

cs-api-definition
public static InputBindingCollection GetInputBindings(DependencyObject element)

Parameters

element

DependencyObject

The element.

Returns

InputBindingCollection

InvalidateRequerySuggested()

Forces the CommandManager to raise the RequerySuggested event.

Declaration

cs-api-definition
public static void InvalidateRequerySuggested()

RegisterClassCommandBinding(Type, CommandBinding)

Registers a CommandBinding with the specified type.

Declaration

cs-api-definition
public static void RegisterClassCommandBinding(Type type, CommandBinding commandBinding)

Parameters

type

Type

The type.

commandBinding

CommandBinding

The command binding.

RegisterClassInputBinding(Type, InputBinding)

Registers the specified InputBinding with the specified type.

Declaration

cs-api-definition
public static void RegisterClassInputBinding(Type type, InputBinding inputBinding)

Parameters

type

Type

The type.

inputBinding

InputBinding

The input binding.

RemoveCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)

Detaches the specified CanExecuteRoutedEventHandler from the specified element.

Declaration

cs-api-definition
public static void RemoveCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

CanExecuteRoutedEventHandler

The handler.

RemoveExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)

Detaches the specified ExecutedRoutedEventHandler from the specified element.

Declaration

cs-api-definition
public static void RemoveExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

ExecutedRoutedEventHandler

The handler.

RemovePreviewCanExecuteHandler(DependencyObject, CanExecuteRoutedEventHandler)

Detaches the specified CanExecuteRoutedEventHandler from the specified element.

Declaration

cs-api-definition
public static void RemovePreviewCanExecuteHandler(DependencyObject element, CanExecuteRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

CanExecuteRoutedEventHandler

The handler.

RemovePreviewExecutedHandler(DependencyObject, ExecutedRoutedEventHandler)

Detaches the specified ExecutedRoutedEventHandler from the specified element.

Declaration

cs-api-definition
public static void RemovePreviewExecutedHandler(DependencyObject element, ExecutedRoutedEventHandler handler)

Parameters

element

DependencyObject

The element.

handler

ExecutedRoutedEventHandler

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

cs-api-definition
public static void SetCommandBindings(DependencyObject element, CommandBindingCollection value)

Parameters

element

DependencyObject

The element.

value

CommandBindingCollection

The value.

SetInputBindings(DependencyObject, InputBindingCollection)

Sets the collection of input bindings associated with this element.

Declaration

cs-api-definition
public static void SetInputBindings(DependencyObject element, InputBindingCollection value)

Parameters

element

DependencyObject

The element.

value

InputBindingCollection

The value.

Events

RequerySuggested

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

Declaration

cs-api-definition
public static event EventHandler RequerySuggested

Event Value

EventHandler