Articles in this section
Category / Section

How to add additional attributes for your appointments ?

1 min read


In SfSchedule, you can add additional attributes for your appointments. You need to create a separate class which inherits from ScheduleAppointment and include required properties in this class for adding additional attribute to appointment. In this section, additional attribute (Appointment ID) is added to an appointment.



    public class CustomAppointment : ScheduleAppointment
        private string appointment_ID;
        public string AppointmentID
            get { return appointment_ID; }
            set { appointment_ID = value; }



            public ObservableCollection<CustomAppointment> appointmentCollection { get ; set; }
           public ScheduleViewModel()
            CustomAppointment  scheduleAppointment = new CustomAppointment();
            scheduleAppointment.Subject = "Meeting";            scheduleAppointment.AppointmentID = "579";
            scheduleAppointment.Color = Color.Green;
            scheduleAppointment.StartTime = DateTime.Now.Date.AddHours(10);
            scheduleAppointment.EndTime = DateTime.Now.Date.AddHours(12);
            AppointmentCollection = new ObservableCollection<CustomAppointment>();



       x:Name="schedule" ScheduleView="WeekView" 
       DataSource = "{Binding AppointmentCollection}" 
       VerticalOptions="FillAndExpand" >



In the CellTapped event of Schedule, you can get the appointment information along with additional attribute included in the argument of the event.



         schedule.CellTapped += CellTappedEventHandler;
        void CellTappedEventHandler(object sender, CellTappedEventArgs e)
           var appointment = e.Appointment as CustomAppointment;
           if(appointment != null && appointment.Subject == "Meeting")
                DisplayAlert("Appointment details", appointment.AppointmentID, "ok");


You can download the complete project from here ScheduleSample.


The following screenshot displays the output of the mentioned project.


added additional attributes in Schedular

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Please  to leave a comment
Access denied
Access denied