2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
In SfSchedule You can move to required time while switching Schedule view by using MoveToTime support in CellTapped event which will be fired while tapping schedule cell.
XAML < syncfusion :SfSchedule x:Name="schedule" ScheduleView="MonthView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" > </syncfusion :SfSchedule>
In CellTappedEventHandler, set required ScheduleView to be switched. Set NavigateTo to schedule with required hour and date to be moved on tapping a date on month cell. Such that view moves to that particular date and time in day view. Time of the day can be positioned in center of the view while switching from month view to day view by setting current time to the date and subtracting the hours needed from the current time of the day.
C# schedule.CellTapped += CellTappedEventHandler; void CellTappedEventHandler(object sender, CellTappedEventArgs e) { if (schedule.ScheduleView == ScheduleView.MonthView) { schedule.ScheduleView = ScheduleView.DayView; DateTime currentDate = DateTime.Now; DateTime SpecificDateTime = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, currentDate.Hour, currentDate.Minute, currentDate.Second); var numberOfSecondsPerHour = 3600; var requiredHours = 6; schedule.NavigateTo(e.Datetime.AddSeconds((SpecificDateTime.Hour - requiredHours) * numberOfSecondsPerHour)); } }
You can download the source code for entire demo of switching schedule view through event from here, ScheduleSample. |
2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.