Class CommandHelpers
Implements cache for commands and command register methods
Inheritance
Inherited Members
Namespace: EmptyKeys.UserInterface.Input
Assembly: EmptyKeys.UserInterface.dll
Syntax
public static class CommandHelpers
Fields
CanExecuteEvent
The can execute event
Declaration
public static readonly RoutedEvent CanExecuteEvent
Field Value
Type | Description |
---|---|
RoutedEvent |
ExecutedEvent
The executed event
Declaration
public static readonly RoutedEvent ExecutedEvent
Field Value
Type | Description |
---|---|
RoutedEvent |
PreviewCanExecuteEvent
The preview can execute event
Declaration
public static readonly RoutedEvent PreviewCanExecuteEvent
Field Value
Type | Description |
---|---|
RoutedEvent |
PreviewExecutedEvent
The preview executed event
Declaration
public static readonly RoutedEvent PreviewExecutedEvent
Field Value
Type | Description |
---|---|
RoutedEvent |
Methods
AddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)
Adds the can execute handler.
Declaration
public static void AddCanExecuteHandler(UIElement element, CanExecuteRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
CanExecuteRoutedEventHandler | handler | The handler. |
AddExecutedHandler(UIElement, ExecutedRoutedEventHandler)
Adds the preview executed handler.
Declaration
public static void AddExecutedHandler(UIElement element, ExecutedRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
ExecutedRoutedEventHandler | handler | The handler. |
AddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)
Adds the preview can execute handler.
Declaration
public static void AddPreviewCanExecuteHandler(UIElement element, CanExecuteRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
CanExecuteRoutedEventHandler | handler | The handler. |
AddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler)
Adds the preview executed handler.
Declaration
public static void AddPreviewExecutedHandler(UIElement element, ExecutedRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
ExecutedRoutedEventHandler | handler | The handler. |
ExecuteCommandSource(ICommandSource)
Executes the command source.
Declaration
public static void ExecuteCommandSource(ICommandSource commandSource)
Parameters
Type | Name | Description |
---|---|---|
ICommandSource | commandSource | The command source. |
RegisterClassCommandBinding(Type, CommandBinding)
Registers the class command binding.
Declaration
public static void RegisterClassCommandBinding(Type controlType, CommandBinding commandBinding)
Parameters
Type | Name | Description |
---|---|---|
System.Type | controlType | Type of the control. |
CommandBinding | commandBinding | The command binding. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Control Type or Command Binding |
RegisterClassInputBinding(Type, InputBinding)
Registers the class input binding.
Declaration
public static void RegisterClassInputBinding(Type controlType, InputBinding inputBinding)
Parameters
Type | Name | Description |
---|---|---|
System.Type | controlType | Type of the control. |
InputBinding | inputBinding | The input binding. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | controlType or inputBinding |
RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)
Removes the can execute handler.
Declaration
public static void RemoveCanExecuteHandler(UIElement element, CanExecuteRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
CanExecuteRoutedEventHandler | handler | The handler. |
RemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler)
Removes the preview executed handler.
Declaration
public static void RemoveExecutedHandler(UIElement element, ExecutedRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
ExecutedRoutedEventHandler | handler | The handler. |
RemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)
Removes the preview can execute handler.
Declaration
public static void RemovePreviewCanExecuteHandler(UIElement element, CanExecuteRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
CanExecuteRoutedEventHandler | handler | The handler. |
RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler)
Removes the preview executed handler.
Declaration
public static void RemovePreviewExecutedHandler(UIElement element, ExecutedRoutedEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element. |
ExecutedRoutedEventHandler | handler | The handler. |