Skip to main content

PageAdornerControl.BackCommand Property

Gets or sets the command associated with the PageAdornerControl‘s Back Button.

Namespace: DevExpress.Xpf.WindowsUI

Assembly: DevExpress.Xpf.Controls.v24.1.dll

NuGet Package: DevExpress.Wpf.Controls

Declaration

public ICommand BackCommand { get; set; }

Property Value

Type Description
ICommand

An ICommand object that is the command associated with the PageAdornerControl‘s Back Button.

Remarks

Use the PageAdornerControl.ShowBackButton property to display or hide the PageAdornerControl‘s Back Button. By default, clicking a Back Button will navigate to either the previous view, or to root view, depending on the NavigationFrame.BackNavigationMode property value of a NavigationFrame container involved in navigation. See the Navigation topic to learn more.

You can assign your own command to the Back Button via the BackCommand property. The code below demonstrates the example.

private bool canExecuteFunc() {
    //checks specific conditions and determines whether our custom command can be executed in its current state
    if (. . .) return true;
    else return false;
}

private void executeFunc() {
    //performs specific actions
    . . .
}

public myView1() {
    InitializeComponent();
    //defines the custom command and assigns it to the container's back button
    DevExpress.Mvvm.DelegateCommand cmdBack = new DevExpress.Mvvm.DelegateCommand(executeFunc, canExecuteFunc);
    pageAdornerControl1.BackCommand = cmdBack;
    pageAdornerControl1.ShowBackButton = true;
}
See Also