Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BackstageButtonItem.Command Property

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

Namespace: DevExpress.Xpf.Ribbon

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

NuGet Package: DevExpress.Wpf.Ribbon

#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:

pasteButton.Command = ApplicationCommands.Paste;
pasteButton.CommandTarget = 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.

See Also