How to display appointment details OnTapped event?

New to .net maui question.  How do I display the appointment details in a flyout when the user taps an appointment on the scheduler control?  I have the event captured but cannot get a form to display or the desired format which is a flyout with the details.  This is what I have:

    private void OnSchedulerTapped(object sender, SchedulerTappedEventArgs e)

    {

        var appointments = e.Appointments;

        var selectedDate = e.Date;

        var schedulerElement = e.Element;


        if (appointments != null)

        {

            Shell.Current.GoToAsync(nameof(ScheduleDetailPage));

        }

    }


and the ScheduleDetailPage is the default Welcome to .Net Maui message

Thanks.


1 Reply 1 reply marked as answer

SS SaiGanesh Sakthivel Syncfusion Team June 6, 2023 01:03 PM UTC

Hi Phill,


You can achieve your requirement by passing the datetime parameter to the display page. Please refer to the code snippet for your reference.


Code snippet

private void Scheduler_Tapped(object sender, SchedulerTappedEventArgs e)

{

    if (e.Element == SchedulerElement.SchedulerCell || e.Element == SchedulerElement.Appointment)

    {

        if (e.Appointments != null)

        {

            this.Navigation.PushAsync(new EditorPage((SchedulerAppointment)e.Appointments[0], (e.Appointments[0] as SchedulerAppointment).StartTime, this.Scheduler));

        }

        else

        {

            this.Navigation.PushAsync(new EditorPage(null, (DateTime)e.Date, this.Scheduler));

        }

    }

}


Please refer to the demo sample in the attachment. Please let us know if you have any concerns.


Regards,
SaiGanesh Sakthivel


Attachment: SchedulerMAUI_(6)_dc89528e.zip

Marked as answer
Loader.
Up arrow icon