Xamarin.Forms Guides | Samples

Xamarin.Forms.INavigation.PushAsync Method

Asynchronously adds a Page to the top of the navigation stack.

Syntax

public Task PushAsync (Page page)

Parameters

page
The Page to be pushed on top of the navigation stack.

Returns

A task representing the asynchronous dismiss operation.

Remarks

The following example shows INavigation.Push and INavigation.Pop usage:

C# Example

var newPage = new ContentPage ();
await Navigation.PushAsync (newPage);
Debug.WriteLine ("the new page is now showing");
var poppedPage = await Navigation.PopAsync ();
Debug.WriteLine ("the new page is dismissed");
Debug.WriteLine (Object.ReferenceEquals (newPage, poppedPage)); //prints "true"

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0