VisualElement.Navigation VisualElement.Navigation Property


Gets the context aware navigation interface for the element.

public Xamarin.Forms.INavigation Navigation { get; }
member this.Navigation : Xamarin.Forms.INavigation

Property Value

An INavigation that allows for navigation using the ancestral navigation implementor.


Use the Navigation property to perform navigation from any element. If the element has not yet been added to a tree which contains a navigation implementor, the actions are queued up until it is.

The following example navigates to a new page created in the callback of a button's Clicked event.

  partial class NavigationTest {
    void BuildContent 
      Button button = new Button {Text = "Tap to Navigate"};
      button.Clicked += OnButtonClicked;

    void OnButtonClicked (object sender, EventArgs args)
      Button button = (Button) sender;
      Page newPage = new ContentPage {
        Content = new Label {Text = "Hello New Page"}

      button.Navigation.Push (newPage);

Applies to