Events in .NET MAUI AI-Powered Scheduler (SfSmartScheduler)
21 Jul 20261 minute to read
The SfSmartScheduler supports the AssistAppointmentResponseCompleted event to interact with .NET MAUI smart Scheduler.
AssistAppointmentResponseCompleted Event
The SfSmartScheduler control raises the AssistAppointmentResponseCompleted event when an appointment is created or modified through AI assistance. The appointment, assistant response, handled state, and action are passed through the AssistAppointmentResponseCompletedEventArgs. This argument provides the following details:
-
Appointment : The appointment details as a
SchedulerAppointmentobject containing all appointment properties (Subject, StartTime, EndTime, etc.). -
Handled : A boolean value (default:
false) indicating whether the event has been handled. Set totrueto prevent the default appointment handling behavior. - AssistantResponse : The text response from the AI assistant describing the appointment action (e.g., “Meeting scheduled for tomorrow at 2 PM”).
-
Action : An
AppointmentActionenum value indicating the operation:Add,Edit, orDelete.
The following example demonstrates how to handle the AssistAppointmentResponseCompleted event.
<ContentPage
. . .
xmlns:smartScheduler="clr-namespace:Syncfusion.Maui.SmartScheduler;assembly=Syncfusion.Maui.SmartScheduler">
<smartScheduler:SfSmartScheduler x:Name="smartScheduler"
AssistAppointmentResponseCompleted="OnAssistAppointmentResponseCompleted"/>
</ContentPage>using Syncfusion.Maui.SmartScheduler;
. . .
private void OnAssistAppointmentResponseCompleted(object sender, AssistAppointmentResponseCompletedEventArgs e)
{
SchedulerAppointment? appointment = e.Appointment;
string response = e.AssistantResponse;
if (e.Action == AppointmentAction.Add)
{
e.Handled = true;
}
}