BaseObjectSpace.ConfirmationRequired Event
Occurs when performing refresh or rollback operations with the current Object Space’s persistent objects.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Event Data
The ConfirmationRequired event's data class is DevExpress.ExpressApp.ConfirmationEventArgs.
Remarks
The ConfirmationRequired event is raised as a result of calling the BaseObjectSpace.Refresh or BaseObjectSpace.Rollback method. Handle it to invoke a confirmation window of the type specified as the handler’s ConfirmationEventArgs.ConfirmationType parameter. For this purpose, use the XafApplication.AskConfirmation method. It will show the required window with three buttons: Yes, No and Cancel. The end-user’s selection will be returned as the ConfirmationResult enumeration value. Set this value to the handler’s ConfirmationEventArgs.ConfirmationResult parameter. This will specify the remaining actions to be taken in the method which raised this event.
The following code demonstrates how to handle the ConfirmationRequired event via a View Controller:
public class MyViewController : ViewController {
private void ObjectSpace_ConfirmationRequired(object sender, ConfirmationEventArgs e) {
e.ConfirmationResult = Application.AskConfirmation(e.ConfirmationType);
}
private void MyViewController_Activated(object sender, EventArgs e) {
View.ObjectSpace.ConfirmationRequired +=
new EventHandler<ConfirmationEventArgs>(ObjectSpace_ConfirmationRequired);
}
}
The ConfirmationRequired event is already handled by the WinModificationsController, activated for Detail Views in Windows Forms applications only. This Controller’s handler invokes a confirmation window as described above. When the ConfirmationRequired method is invoked within a List View, or in an ASP.NET Web Forms application, a confirmation window is not invoked. You can change this behavior by handling the ConfirmationRequired event.