This repository was archived by the owner on Aug 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
NavigationBackCommand
Mark Smith edited this page Sep 2, 2016
·
1 revision
The NavigationBackCommand
is an ICommand
implementation that uses the registered INavigationService
to perform a GoBackAsync
. It optionally can monitor the navigation stack and change the command state (CanExecute
) based on whether pages exist on the stack.
Note: This class cannot be instantiated on it's own. Instead, a single instance of the command is exposed through a static property on the NavigationCommands class. You should use this property to execute the command.
-
MonitorNavigationStack
: boolean indicating whether to monitor the navigation stack and flip the currentCanExecute
state for the command. By default this is turned off and the command is always valid, but you can set the property totrue
to enable this feature if you have some sort of global UI which can be enabled/disabled.
<ContentPage ... xmlns:cmds="XamarinUniversity.Commands;assembly=XamU.Infrastructure" ...>
...
<Button Text="Go Back" Command="{x:Static cmds:NavigationCommands.NavigateBackCommand}" />