INavigation.PopModalAsync INavigation.PopModalAsync Method

Definition

Overloads

PopModalAsync() PopModalAsync()

Asynchronously dismisses the most recent modally presented Page.

PopModalAsync(Boolean) PopModalAsync(Boolean)

Asynchronously dismisses the most recent modally presented Page, with optional animation.

PopModalAsync() PopModalAsync()

Asynchronously dismisses the most recent modally presented Page.

public System.Threading.Tasks.Task<Xamarin.Forms.Page> PopModalAsync ();
abstract member PopModalAsync : unit -> System.Threading.Tasks.Task<Xamarin.Forms.Page>
Returns

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

Remarks

The following example shows PushModalAsync and PopModalAsync usage:


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 PushModalAsync(Page) and PopModalAsync(). Calling Wait() may cause a deadlock if a previous call to PushModalAsync(Page) or PopModalAsync() has not completed.

PopModalAsync(Boolean) PopModalAsync(Boolean)

Asynchronously dismisses the most recent modally presented Page, with optional animation.

public System.Threading.Tasks.Task<Xamarin.Forms.Page> PopModalAsync (bool animated);
abstract member PopModalAsync : bool -> System.Threading.Tasks.Task<Xamarin.Forms.Page>
Parameters
animated
Boolean Boolean

Whether to animate the pop.

Returns

Applies to