wpf-devexpress-dot-xpf-dot-windowsui-dot-pageadornercontrol-2f24fd51.md
Gets or sets the command associated with the PageAdornerControl‘s Back Button.
Namespace : DevExpress.Xpf.WindowsUI
Assembly : DevExpress.Xpf.Controls.v25.2.dll
NuGet Package : DevExpress.Wpf.Controls
public ICommand BackCommand { get; set; }
Public Property BackCommand As ICommand
| Type | Description |
|---|---|
| ICommand |
An ICommand object that is the command associated with the PageAdornerControl‘s Back Button.
|
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;
}
Private Function canExecuteFunc() As Boolean
'checks specific conditions and determines whether our custom command can be executed in its current state
If ... Then
Return True
Else
Return False
End If
End Function
Private Sub executeFunc()
'performs specific actions
. . .
End Sub
Public Sub myView1()
InitializeComponent()
'defines the custom command and assigns it to the container's back button
Dim cmdBack As DevExpress.Mvvm.DelegateCommand = New DevExpress.Mvvm.DelegateCommand(AddressOf executeFunc, AddressOf canExecuteFunc)
pageAdornerControl1.BackCommand = cmdBack
pageAdornerControl1.ShowBackButton = True
End Sub
See Also