Back to Devexpress

HamburgerMenu.GoBackCommand Property

wpf-devexpress-dot-xpf-dot-windowsui-dot-hamburgermenu-089cc17a.md

latest2.7 KB
Original Source

HamburgerMenu.GoBackCommand Property

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

Declaration

csharp
public ICommand GoBackCommand { get; set; }
vb
Public Property GoBackCommand As ICommand

Property Value

TypeDescription
ICommand

An ICommand object specifying the command which is invoked when the parent’s back button is clicked.

|

Remarks

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.

xaml
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>
csharp
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

HamburgerMenu Class

HamburgerMenu Members

DevExpress.Xpf.WindowsUI Namespace