Skip to content

KeyboardShortcuts.CommandKeyAction

JaykeBird edited this page Feb 21, 2023 · 5 revisions

Back to home | Back to Reference | View raw text

CommandKeyAction class

Description

A key action that executes a command when activated.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.KeyboardShortcuts
  SolidShineUi.KeyboardShortcuts.CommandKeyAction[[CommandKeyAction]]
  SolidShineUi.KeyboardShortcuts.IKeyAction[[IKeyAction]]
  class SolidShineUi.KeyboardShortcuts.IKeyAction interfaceStyle;
  end
  subgraph System.Windows.Input
System.Windows.Input.ICommandSource[[ICommandSource]]
  end
SolidShineUi.KeyboardShortcuts.IKeyAction --> SolidShineUi.KeyboardShortcuts.CommandKeyAction
System.Windows.Input.ICommandSource --> SolidShineUi.KeyboardShortcuts.CommandKeyAction
Loading

Members

Properties

Public properties

Type Name Methods
ICommand Command
Get the command that will be executed when this key action is activated.
get
object CommandParameter
Get the command parameter associated with this key action. When the command is executed, this parameter is also supplied. Note: this can be null.
get
IInputElement CommandTarget
Get the command target to associated with this key action. When the command is executed, it will be executed in relation to this target. Note: this can be null.
get
string ID
Get or set the unique ID associated with this key action.
get, set
UIElement SourceElement
Gets the UI element that this action is related to, if any.
get

Methods

Public methods

Returns Name
void Execute()
Activate this key action.

Details

Summary

A key action that executes a command when activated.

Inheritance

Constructors

CommandKeyAction [1/2]

public CommandKeyAction(ICommand command, object commandParameter, IInputElement commandTarget, string methodId, UIElement sourceItem)
Arguments
Type Name Description
ICommand command The command to execute when this key action is activated.
object commandParameter The parameter to supply with this command. Set to null to not set a parameter.
IInputElement commandTarget The target of the command. Set to null to not set a target.
string methodId The unique ID to associate with this key action.
UIElement sourceItem The UI element, if any, associated with this command. For example, it could be a menu item or button that would alternatively execute this command.
Summary

Create a CommandKeyAction.

CommandKeyAction [2/2]

public CommandKeyAction(ICommand command, string methodId, UIElement sourceItem)
Arguments
Type Name Description
ICommand command The command to execute when this key action is activated.
string methodId The unique ID to associate with this key action.
UIElement sourceItem The UI element, if any, associated with this command. For example, it could be a menu item or button that would alternatively execute this command.
Summary

Create a CommandKeyAction.

Methods

Execute

public virtual void Execute()
Summary

Activate this key action.

Properties

SourceElement

public virtual UIElement SourceElement { get; }
Summary

Gets the UI element that this action is related to, if any.

CommandParameter

public virtual object CommandParameter { get; }
Summary

Get the command parameter associated with this key action. When the command is executed, this parameter is also supplied. Note: this can be null.

CommandTarget

public virtual IInputElement CommandTarget { get; }
Summary

Get the command target to associated with this key action. When the command is executed, it will be executed in relation to this target. Note: this can be null.

ID

public virtual string ID { get; set; }
Summary

Get or set the unique ID associated with this key action.

Command

public virtual ICommand Command { get; }
Summary

Get the command that will be executed when this key action is activated.

Generated with ModularDoc

Clone this wiki locally