wpf-devexpress-dot-xpf-dot-windowsui-dot-hamburgermenu-089cc17a.md
Gets or sets the command which is invoked when the parent’s back button is clicked.
Namespace : DevExpress.Xpf.WindowsUI
Assembly : DevExpress.Xpf.Controls.v25.2.dll
NuGet Package : DevExpress.Wpf.Controls
public ICommand GoBackCommand { get; set; }
Public Property GoBackCommand As ICommand
| Type | Description |
|---|---|
| ICommand |
An ICommand object specifying the command which is invoked when the parent’s back button is clicked.
|
If the menu’s parent supports the back navigation (for instance, the ThemedWindow supports this feature; see ThemedWindow.NavigateBackCommand), you can synchronize the menu’s back command with the parent’s back command by enabling the HamburgerMenu.SyncWithWindowBackButton option.
By default, the back command navigates back to the previously displayed navigation page. Using the GoBackCommand property, you can provide a custom back command.
xmlns:dxwui="http://schemas.devexpress.com/winfx/2008/xaml/windowsui"
<Window.CommandBindings>
<CommandBinding Command="NavigationCommands.BrowseBack"
CanExecute="CommandBinding_CanExecute"
Executed="CommandBinding_Executed"/>
</Window.CommandBindings>
<dxwui:HamburgerMenu x:Name="menu"
AllowBuiltInNavigation="True"
GoBackCommand="NavigationCommands.BrowseBack"
SyncWithWindowBackButton="True"
IsWindowBackButtonVisible="True">
</dxwui:HamburgerMenu>
private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
e.CanExecute = true;
}
private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) {
MessageBox.Show("Browse Back");
}
See Also