protected override void OnAttachedTo(ContentPage bindable) { base.OnAttachedTo(bindable); schedule = bindable.FindByName <SfSchedule>("schedule"); schedule.TimeInterval = 1; WeekViewSettings weekViewSettings = new WeekViewSettings(); weekViewSettings.WorkStartHour = 0; weekViewSettings.WorkEndHour = 23; WeekLabelSettings weekLabelSettings = new WeekLabelSettings(); weekLabelSettings.TimeFormat = string.Format("'Room'") + " " + "HH"; weekViewSettings.WeekLabelSettings = weekLabelSettings; schedule.WeekViewSettings = weekViewSettings; TimelineViewSettings timelineViewSettings = new TimelineViewSettings(); timelineViewSettings.StartHour = 0; timelineViewSettings.EndHour = 1; schedule.TimelineViewSettings = timelineViewSettings; TimelineLabelSettings labelSettings = new TimelineLabelSettings(); labelSettings.TimeFormat = string.Format(" 'Room' ") + " " + "mm"; timelineViewSettings.LabelSettings = labelSettings; }
protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); if (width != this.width || height != this.height) { this.width = width; this.height = height; if (width > height) { Debug.WriteLine("Horizontal"); Device.BeginInvokeOnMainThread(() => { /* Switching to Week View * * Current Bug on Week View: All Day Events show up as an extra day long. * Should not be programmed to subtract a day in datetime because the overall standard * is that all day events are from one day at 0:0:0 to the next day at 0:0:0. * * SyncFusion says this bug should be fixed in their update at the end of May 2018 so * please update the NuGet package then. * * https://www.syncfusion.com/forums/137099/all-day-event-rendering-as-two-days-in-week-view * */ cal.ScheduleView = ScheduleView.WeekView; cal.TimeIntervalHeight = 50; cal.ViewHeaderHeight = 55; //Creating new instance of WeekViewSettings WeekViewSettings weekViewSettings = new WeekViewSettings(); //Creating new instance of WeekLabelSettings WeekLabelSettings weekLabelSettings = new WeekLabelSettings(); //custom UI weekLabelSettings.DateFormat = "dd"; weekViewSettings.WeekLabelSettings = weekLabelSettings; weekViewSettings.ShowAllDay = true; weekViewSettings.StartHour = 05; cal.WeekViewSettings = weekViewSettings; ViewHeaderStyle viewHeaderStyle = new ViewHeaderStyle(); viewHeaderStyle.DateFontSize = 15; cal.ViewHeaderStyle = viewHeaderStyle; }); } else { Debug.WriteLine("Vertical"); Device.BeginInvokeOnMainThread(() => { cal.ScheduleView = ScheduleView.MonthView; }); } } }