Xamarin.Forms Guides | Samples

Xamarin.Forms.INavigation.PushModalAsync Method

Presents a Page modally.

Syntax

public Task PushModalAsync (Page page)

Parameters

page
The Page to present modally.

Returns

An awaitable Task, indicating the PushModal completion.

Remarks

The following example shows PushModalAsync and PopModalAsync usage:

C# Example

var modalPage = new ContentPage ();
await Navigation.PushModalAsync (modalPage);
Debug.WriteLine ("The modal page is now on screen");
var poppedPage = await Navigation.PopModalAsync ();
Debug.WriteLine ("The modal page is dismissed");
Debug.WriteLine (Object.ReferenceEquals (modalPage, 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