共用方式為


INavigation.PopModalAsync Method

Definition

Overloads

PopModalAsync()

Asynchronously dismisses the most recent modally presented Page.

PopModalAsync(Boolean)

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

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

System.Threading.Tasks.Task<Page>

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"

Applies to

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
System.Boolean

Whether to animate the pop.

Returns

System.Threading.Tasks.Task<Page>

Applies to