Using VisualStudio SFSchedule, having difficulties with adding custom Appointments

Hi there,

I have made substantial headway with setting up my models, services, JSON, and Viewmodels. I am now up to designing my Views. I have created a working SFSchedule, however I can't seem to add/remove custom appointments to this.

I have already gone through all of the SFSchedule Docs and I am coming up short each time. I have created an instance of SFSchedule, but cannot initialise it with SFSchedule(this) in my Mainpage.xaml.cs codebehind. 

I am using ScheudleView.WorkWeek, and so I have successfully set all of the viewHeaderStyles to my liking, however when it comes to adding appointments in timeslots I can't seem to access 'SetContentView(schedule)' or schedule.ItemSource = meetings.

using Syncfusion.SfSchedule.XForms;
        using System;
        using Xamarin.Forms;
        public TimetablePage()
        {
            InitializeComponent();
 
 
            SfSchedule schedule = new SfSchedule();
            schedule.ScheduleView = ScheduleView.WorkWeekView;
 
            ViewHeaderStyle viewHeaderStyle = new ViewHeaderStyle();
            viewHeaderStyle.BackgroundColor = Color.FromHex("#009688");
            viewHeaderStyle.DayTextColor = Color.FromHex("#FFFFFF");
            viewHeaderStyle.DateTextColor = Color.FromHex("#FFFFFF");
            viewHeaderStyle.DayFontFamily = "Arial";
            viewHeaderStyle.DateFontFamily = "Arial";
            schedule.ViewHeaderStyle = viewHeaderStyle;
            schedule.SelectedDate = null;
            CreateAppointments();
            schedule.ItemSource = Meetings; // Does not contain this definition
            SetContentView(schedule); // Does not exist in current context.
        }

1 Reply 1 reply marked as answer

MS Muniappan Subramanian Syncfusion Team July 20, 2020 09:31 AM UTC

Hi Andrew, 
 
We checked your query "Using VisualStudio SFSchedule, having difficulties with adding custom Appointments". SetContentView and ItemSource are used for Native platform (Xamarin. Android and Xamarin. iOS). In Xamarin.Forms platform you need to assign the created collection to the DataSource property of the schedule, and you need to assign the SfSchedule control to the Content property of the content page. We have prepared the sample for the same, please find the sample from below link, 
 
 
If you want native sample, please refer the following User Guide documentation regarding the same, 
 
We hope that this helps you, kindly revert us if you have any concern.   
 
Regards,   
Muniappan S.   


Marked as answer
Loader.
Up arrow icon