Skip to main content

MessageBoxServiceExtensions.ShowAsync(IMessageBoxService, String, String, MessageButton, Nullable<MessageResult>, Nullable<MessageResult>) Method

Shows a message box with specified parameters.

Namespace: DevExpress.Mvvm

Assembly: DevExpress.WinUI.Mvvm.v23.2.dll

NuGet Package: DevExpress.WinUI

#Declaration

public static Task<MessageResult> ShowAsync(
    this IMessageBoxService service,
    string content,
    string title,
    MessageButton buttons = MessageButton.OK,
    MessageResult? defaultResult = null,
    MessageResult? cancelResult = null
)

#Parameters

Name Type Description
service IMessageBoxService
content String

The text shown within the message box.

title String

The title of the message box.

#Optional Parameters

Name Type Default Description
buttons MessageButton OK

The set of buttons shown within the message box.

defaultResult Nullable<MessageResult> null

Specifies which message box button is default. A default button is highlighted when a message box is shown.

cancelResult Nullable<MessageResult> null

Specifies which message box button is the cancel button. The cancel button’s command is invoked when a user presses the Esc key while the MessageBox is focused.

#Returns

Type Description
Task<MessageResult>

The task that includes the button that the user clicked.

See Also