Version

Configuring Keyboard Shortcuts (xamDiagram)

Topic Overview

Purpose

This topic explains how to change the keyboard shortcuts associated with xamDiagram™ commands.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides a conceptual overview of the xamDiagram control and its main features and capabilities.

This topic explains the operational logic of the commands available in the xamDiagram control.

This topic explains how to add the xamDiagram control to a WPF application.

Configuring Keyboard Shortcuts

Overview

To change the pre-configured keyboard shortcut for a command, you need to create a new KeyBinding object specifying the new settings. If you want to completely override the existing settings, you should make sure to clear the existing input gestures.

Property settings

The following table maps the desired configuration to the property settings that manage it.

In order to: Use this property: And set it to:

Create a KeyBinding for the copy command

A new KeyBinding object, containing information for the new key shortcut and the command target.

This object should then be added to the InputBindings collection of the Window.

Example

This example demonstrates the property settings needed to configure a new shortcut for the Copy command of the diagram – F4 in addition to the standard Ctrl+C key combination. For a walkthrough on adding a diagram to your application, see Adding xamDiagram to a Page.

Note
Note:

The settings below add the new key shortcut ( F4 ) for the Copy command, but do not override the default shortcut ( Ctrl+C ). In order to override it, you must clear the existing InputGestures associated with the command.

The screenshot below demonstrates how the xamDiagram behaves as a result of the following settings:

Property Value

In XAML:

<KeyBinding Command="Copy" Key="F4" CommandTarget="{Binding ElementName=diagram}"/>

Following is the code that implements this example.

In XAML:

<Window.InputBindings>
      <KeyBinding Command="Copy" Key="F4" CommandTarget="{Binding ElementName=diagram}"/>
</Window.InputBindings>

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides a summary of all user interaction tasks in the xamDiagram control.

The topic covers configuring an Undo/Redo Manager that is exclusive for the xamDiagram control.

This topic explains how to use the commands provided by the xamDiagram in UI elements such as menus and buttons.