<KeyBinding Command="Copy" Key="F4" CommandTarget="{Binding ElementName=diagram}"/>
This topic explains how to change the keyboard shortcuts associated with xamDiagram™ commands.
The following topics are prerequisites to understanding this topic:
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.
The following table maps the desired configuration to the property settings that manage it.
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.
The screenshot below demonstrates how the xamDiagram behaves as a result of the following settings:
Following is the code that implements this example.
In XAML:
<Window.InputBindings>
<KeyBinding Command="Copy" Key="F4" CommandTarget="{Binding ElementName=diagram}"/>
</Window.InputBindings>
The following topics provide additional information related to this topic.