Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

NavigationToCommand

Mark Smith edited this page Jul 7, 2017 · 4 revisions

NavigationToCommand

The NavigationToCommand is an ICommand implementation that uses the registered INavigationService to perform a NavigateAsync to the passed page key parameter. If no parameter is passed, the command will not execute.

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 named NavigateTo. You should use this property to execute the command.

Example

<ContentPage ... xmlns:cmds="clr-namespace:XamarinUniversity.Commands;assembly=XamU.Infrastructure" ...>
    ...
   <Button Text="About" 
        Command="{x:Static cmds:NavigationCommands.NavigateTo}"
        CommandParameter="aboutPageKey" />