Xamarin.Forms Guides | Samples

Xamarin.Forms.INavigation.PopModalAsync Method

Asynchronously dismisses the most recent modally presented Page.


public System.Threading.Tasks.Task<Page> PopModalAsync ()


An awaitable Task<Page>, indicating the PopModalAsync completion. The Task.Result is the Page that has been popped.


The following example shows PushModal and PopModal 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"

Application developers must await the result of INavigation.PushModal and INavigation.PopModal. Calling Task.Wait may cause a deadlock if a previous call to INavigation.PushModal or INavigation.PopModal has not completed.


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,