Skip to main content
A newer version of this page is available. .

BackstageButtonItem.Command Property

Gets or sets a command fired when the button item is clicked.

Namespace: DevExpress.Xpf.Ribbon

Assembly: DevExpress.Xpf.Ribbon.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Ribbon, DevExpress.Wpf.Navigation

Declaration

public ICommand Command { get; set; }

Property Value

Type Description
ICommand

A ICommand object, fired when the button item is clicked.

Remarks

You can define an action that will happen when the BackstageButtonItem is clicked by setting the Command property. The command must be defined in Window.CommandBindings section in order to make it reusable for different controls. If the Command is a RoutedCommand, you may want to define the BackstageButtonItem.CommandTarget.

The following code shows an example of binding a predefined Paste command to a button:

<dxr:BackstageButtonItem Name ="pasteButton" Content="Paste" Command="ApplicationCommands.Paste" CommandTarget="{Binding ElementName=textBox2}" />

To learn more about commands, see the Commanding Overview and ICommand Interface articles in MSDN.

You can also implement an action for a button via the BackstageItemBase.Click event.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Command property.

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.

See Also