Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Page.DisplayAlertAsync Method

Definition

Namespace:
Microsoft.Maui.Controls
Assembly:
Microsoft.Maui.Controls.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
DisplayAlertAsync(String, String, String)

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

DisplayAlertAsync(String, String, String, FlowDirection)

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

DisplayAlertAsync(String, String, String, String)

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

DisplayAlertAsync(String, String, String, String, FlowDirection)

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

DisplayAlertAsync(String, String, String)

Source:
Page.cs
Source:
Page.cs

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

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

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.

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

DisplayAlertAsync(String, String, String, FlowDirection)

Source:
Page.cs
Source:
Page.cs

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

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

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.

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

DisplayAlertAsync(String, String, String, String)

Source:
Page.cs
Source:
Page.cs

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

public:
 System::Threading::Tasks::Task<bool> ^ DisplayAlertAsync(System::String ^ title, System::String ^ message, System::String ^ accept, System::String ^ cancel);
public System.Threading.Tasks.Task<bool> DisplayAlertAsync(string title, string message, string accept, string cancel);
member this.DisplayAlertAsync : string * string * string * string -> System.Threading.Tasks.Task<bool>
Public Function DisplayAlertAsync (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. 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.

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

DisplayAlertAsync(String, String, String, String, FlowDirection)

Source:
Page.cs
Source:
Page.cs

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

public:
 System::Threading::Tasks::Task<bool> ^ DisplayAlertAsync(System::String ^ title, System::String ^ message, System::String ^ accept, System::String ^ cancel, Microsoft::Maui::FlowDirection flowDirection);
public System.Threading.Tasks.Task<bool> DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection);
member this.DisplayAlertAsync : string * string * string * string * Microsoft.Maui.FlowDirection -> System.Threading.Tasks.Task<bool>
Public Function DisplayAlertAsync (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


Feedback

Was this page helpful?