-
Notifications
You must be signed in to change notification settings - Fork 3
KeyboardShortcuts.CommandKeyAction
JaykeBird edited this page Feb 21, 2023
·
5 revisions
Back to home | Back to Reference | View raw text
A key action that executes a command when activated.
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
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 |
Returns | Name |
---|---|
void |
Execute ()Activate this key action. |
A key action that executes a command when activated.
-
IKeyAction
ICommandSource
public CommandKeyAction(ICommand command, object commandParameter, IInputElement commandTarget, string methodId, UIElement sourceItem)
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. |
Create a CommandKeyAction.
public CommandKeyAction(ICommand command, string methodId, UIElement sourceItem)
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. |
Create a CommandKeyAction.
public virtual void Execute()
Activate this key action.
public virtual UIElement SourceElement { get; }
Gets the UI element that this action is related to, if any.
public virtual object CommandParameter { get; }
Get the command parameter associated with this key action. When the command is executed, this parameter is also supplied. Note: this can be null.
public virtual IInputElement CommandTarget { get; }
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.
public virtual string ID { get; set; }
Get or set the unique ID associated with this key action.
public virtual ICommand Command { get; }
Get the command that will be executed when this key action is activated.
Generated with ModularDoc