共用方式為


Page.DisplayAlert Method

Definition

Overloads

DisplayAlert(String, String, String)

Presents an alert dialog to the application user with a single cancel button.

DisplayAlert(String, String, String, String)

Presents an alert dialog to the application user with an accept and a cancel button.

DisplayAlert(String, String, String)

Presents an alert dialog to the application user with a single cancel button.

public System.Threading.Tasks.Task DisplayAlert (string title, string message, string cancel);
member this.DisplayAlert : string * string * string -> System.Threading.Tasks.Task

Parameters

title
System.String

The title of the alert dialog.

message
System.String

The body text of the alert dialog.

cancel
System.String

Text to be displayed on the 'Cancel' button.

Returns

System.Threading.Tasks.Task

Applies to

DisplayAlert(String, String, String, String)

Presents an alert dialog to the application user with an accept and a cancel button.

public System.Threading.Tasks.Task<bool> DisplayAlert (string title, string message, string accept, string cancel);
member this.DisplayAlert : string * string * string * string -> System.Threading.Tasks.Task<bool>

Parameters

title
System.String

The title of the alert dialog.

message
System.String

The body text of the alert dialog.

accept
System.String

Text to be displayed on the 'Accept' button.

cancel
System.String

Text to be displayed on the 'Cancel' button.

Returns

System.Threading.Tasks.Task<System.Boolean>

A task that contains the user's choice as a Boolean value. true indicates that the user accepted the alert. false indicates that the user cancelled the alert.

Applies to