wpf-devexpress-dot-xpf-dot-reports-dot-userdesigner-dot-reportdesigner-dot-registerhotkey-x28-key-modifierkeys-func-icommand-object-x29.md
Registers the specified hot key in the Report Designer.
Namespace : DevExpress.Xpf.Reports.UserDesigner
Assembly : DevExpress.Xpf.ReportDesigner.v25.2.dll
NuGet Package : DevExpress.Wpf.Reporting
public void RegisterHotKey(
Key key,
ModifierKeys modifiers,
Func<ICommand> getCommand,
object parameter
)
Public Sub RegisterHotKey(
key As Key,
modifiers As ModifierKeys,
getCommand As Func(Of ICommand),
parameter As Object
)
| Name | Type | Description |
|---|---|---|
| key | Key |
A Key enumeration value that specifies the hot key to be registered.
| | modifiers | ModifierKeys |
A ModifierKeys enumeration value that specifies modifier keys that should be pressed in combination with the key.
| | getCommand | Func<ICommand> |
A function that returns a command to be executed when the hot key is pressed.
| | parameter | Object |
An object that specifies a command parameter.
|
The following code snippet demonstrates how to register the hot key to invoke the Save As dialog.
using System.Windows.Input;
// ...
reportDesigner.RegisterHotKey(Key.S, ModifierKeys.Control,
() => reportDesigner.ActualCommands.SaveDocumentAsCommand, null);
Imports System.Windows.Input
' ...
reportDesigner.RegisterHotKey(Key.S, ModifierKeys.Control,
Function() reportDesigner.ActualCommands.SaveDocumentAsCommand, Nothing)
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RegisterHotKey(Key, ModifierKeys, Func<ICommand>, Object) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
reporting-wpf-customize-keyboard-shortcuts-in-the-report-designer/CS/T461248/MainWindow.xaml.cs#L20
designer.RegisterHotKey(Key.OemTilde, ModifierKeys.Control, () => viewModel.TestCommand, null);
}
reporting-wpf-customize-keyboard-shortcuts-in-the-report-designer/VB/T461248/MainWindow.xaml.vb#L22
DataContext = viewModel
Me.designer.RegisterHotKey(Key.OemTilde, ModifierKeys.Control, Function() viewModel.TestCommand, Nothing)
End Sub
See Also