Bar

BarItem.KeyGesture Property

Gets or sets a keyboard combination that can be used to invoke the current bar item's functionality. This is a dependency property.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public KeyGesture KeyGesture { get; set; }
Public Property KeyGesture As KeyGesture

Property Value

Type Description
KeyGesture

A KeyGesture object.

Remarks

When a key combination defined by the KeyGesture property is invoked, the item's functionality is invoked as follows:

Examples

This example shows how to specify a command and custom short cut for a bar item. A command and short cut are assigned to the item via the BarItem.Command and BarItem.KeyGesture properties, respectively.In the example, a bar is docked to the BarContainerControl which is created manually.

<dxb:BarManager.Items>                
    <dxb:BarButtonItem Name="btnCut" Command="ApplicationCommands.Cut" KeyGesture="CTRL+1" CommandTarget="{Binding ElementName=textBox}" Content="{Binding Command.Text, RelativeSource={RelativeSource Self}}" />
</dxb:BarManager.Items>

Implements

DevExpress.Xpf.Bars.ICommandSourceServiceSupport.KeyGesture
See Also