SchedulerControl.AppointmentRemoving Event
Occurs when the user removes an appointment.
Namespace: DevExpress.WinUI.Scheduler
Assembly: DevExpress.WinUI.Scheduler.v23.2.dll
NuGet Package: DevExpress.WinUI
#Declaration
public event EventHandler<AppointmentRemovingEventArgs> AppointmentRemoving
#Event Data
The AppointmentRemoving event's data class is AppointmentRemovingEventArgs. The following properties provide information specific to this event:
Property |
---|
Appointments |
#Remarks
The AppointmentRemoving is a deferred event. You can process the event in a synchronous mode pausing the SchedulerControl. For example, it can be useful if you want to prompt the user to save changes.
To pause the SchedulerControl, use the event’s GetDeferral method. It returns an EventDeferral object. To resume the SchedulerControl’s processing, call the EventDeferral.Complete method.
Important
If you don’t call the Event
The example below illustrates how to use the EventDeferral to prompt the user to save changes.
private async void Scheduler_AppointmentRemoving(object sender, DevExpress.WinUI.Scheduler.AppointmentRemovingEventArgs e) {
var deferral = e.GetDeferral();
var dialog = new MessageDialog("Do you want to remove the Appointment?", "Confirmation");
dialog.Commands.Add(new Windows.UI.Popups.UICommand { Label = "Yes", Id = 0 });
dialog.Commands.Add(new Windows.UI.Popups.UICommand { Label = "No", Id = 1 });
var res = await dialog.ShowAsync();
e.Cancel = (int)res.Id == 1;
deferral.Complete();
}