Skip to main content
.NET 6.0+

WinApplication.AskConfirmation(ConfirmationType) Method

Requests an end-user confirmation via the dialog window.

Namespace: DevExpress.ExpressApp.Win

Assembly: DevExpress.ExpressApp.Win.v24.1.dll

NuGet Package: DevExpress.ExpressApp.Win

Declaration

public override ConfirmationResult AskConfirmation(
    ConfirmationType confirmationType
)

Parameters

Name Type Description
confirmationType ConfirmationType

A ConfirmationType enumeration value specifying the confirmation dialog type.

Returns

Type Description
ConfirmationResult

A ConfirmationResult enumeration value, specifying the end-user choice.

Remarks

Overrides the XafApplication.AskConfirmation method. Uses the WinApplication.GetUserChoice method to display a confirmation dialog window of the required type. The user choice is logged.

The following dialog is displayed when the ConfirmationType.NeedSaveChanges value is passed:

AskConfirmation_Save

The “Do you want to save changes?” text is obtained from the Application Model‘s Localization | Confirmations | Save node, and is localizable.

The following dialog is displayed when the ConfirmationType.CancelChanges value is passed:

AskConfirmation_Cancel

The “Do you want to cancel your changes?” text is obtained from the Application Model’s Localization | Confirmations | Cancel node, and is localizable.

This method is used in the WinModificationsController Controller, to display confirmation dialogs when the ModificationsController.CancelAction Action is executed, or the View is closed. To use the AskConfirmation method in a custom Controller, access the WinApplication object via the Controller.Application property.

See Also