define shortcut keys
Overview
As ExtensionPoints unique extension, you can set shortcut keys. You can register a shortcut key and execute the command handler associated with the key.
Use the Register
method of ExtensionPoints.ShortcutKeyCommands
to register shortcut keys.
Implementation example
In this implementation example, pressing Ctrl+I
will execute HelloCommand
.
using using System.Windows.Input;
public class SampleExtensionEntryPoint : ExtensionBase
{
protected override void OnActivate()
{
//register shortcut key
ExtensionPoints.ShortcutKeyCommands.Register<HelloCommand>(Key.I, ModifierKeys.Control);
}
}