Page.DisplayAlert Method

Definition

Overloads

DisplayAlert(String, String, String, String, FlowDirection)

Displays 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.

DisplayAlert(String, String, String, FlowDirection)

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

DisplayAlert(String, String, String, String, FlowDirection)

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

public:
 System::Threading::Tasks::Task<bool> ^ DisplayAlert(System::String ^ title, System::String ^ message, System::String ^ accept, System::String ^ cancel, Microsoft::Maui::FlowDirection flowDirection);
public System.Threading.Tasks.Task<bool> DisplayAlert (string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection);
member this.DisplayAlert : string * string * string * string * Microsoft.Maui.FlowDirection -> System.Threading.Tasks.Task<bool>
Public Function DisplayAlert (title As String, message As String, accept As String, cancel As String, flowDirection As FlowDirection) As Task(Of Boolean)

Parameters

title
String

The title of the alert dialog. Can be null to hide the title.

message
String

The body text of the alert dialog.

accept
String

Text to be displayed on the 'Accept' button. Can be null to hide this button.

cancel
String

Text to be displayed on the 'Cancel' button.

flowDirection
FlowDirection

The flow direction to be used by the alert.

Returns

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.

Exceptions

Thrown when cancel is null or empty.

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(System::String ^ title, System::String ^ message, System::String ^ accept, System::String ^ cancel);
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>
Public Function DisplayAlert (title As String, message As String, accept As String, cancel As String) As Task(Of Boolean)

Parameters

title
String

The title of the alert dialog.

message
String

The body text of the alert dialog.

accept
String

Text to be displayed on the 'Accept' button.

cancel
String

Text to be displayed on the 'Cancel' button.

Returns

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

DisplayAlert(String, String, String)

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

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

Parameters

title
String

The title of the alert dialog.

message
String

The body text of the alert dialog.

cancel
String

Text to be displayed on the 'Cancel' button.

Returns

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

DisplayAlert(String, String, String, FlowDirection)

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

public:
 System::Threading::Tasks::Task ^ DisplayAlert(System::String ^ title, System::String ^ message, System::String ^ cancel, Microsoft::Maui::FlowDirection flowDirection);
public System.Threading.Tasks.Task DisplayAlert (string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection);
member this.DisplayAlert : string * string * string * Microsoft.Maui.FlowDirection -> System.Threading.Tasks.Task
Public Function DisplayAlert (title As String, message As String, cancel As String, flowDirection As FlowDirection) As Task

Parameters

title
String

The title of the alert dialog.

message
String

The body text of the alert dialog.

cancel
String

Text to be displayed on the 'Cancel' button.

flowDirection
FlowDirection

The flow direction to be used by the alert.

Returns

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