Skip to main content

DiagramCommandsBase.RegisterHotKeys(Action<IHotKeysRegistrator>) Method

Allows you to clear the existing shortcuts or define new ones.

Namespace: DevExpress.Diagram.Core

Assembly: DevExpress.Diagram.v23.2.Core.dll

NuGet Package: DevExpress.Diagram.Core

Declaration

public ICommandHotKeys RegisterHotKeys(
    Action<IHotKeysRegistrator> registerHotKeys
)

Parameters

Name Type Description
registerHotKeys Action<DevExpress.Diagram.Core.IHotKeysRegistrator>

An action delegate that clears the existing shortcuts or registers custom ones.

Returns

Type Description
DevExpress.Diagram.Core.ICommandHotKeys

A collection of command handlers.

Remarks

The example below shows how set the F10 key as a shortcut that invokes the Print Preview and clear the shortcut associated with saving the diagram to a file.

diagram.Commands.RegisterHotKeys(x => {
                x.RegisterHotKey(Key.F10, ModifierKeys.None, DiagramCommandsBase.ShowPrintPreviewCommand);
                x.ClearHotKeys(DiagramCommandsBase.SaveFileCommand);
            });
See Also