Defining Non-Working Hours in Scheduler for .NET MAUI
Environment
Version | Product | Author |
---|---|---|
10.0.0 | Scheduler for .NET MAUI | Dobrinka Yordanova |
Description
When transitioning from the Xamarin Calendar and Scheduler to the Telerik Scheduler for .NET MAUI, it's essential to know how to define and display non-working hours in DayView, WeekView, and MultiDayView modes.
This knowledge base article also answers the following questions:
- How can I mark non-working hours in the Telerik Scheduler for .NET MAUI?
- What approach should I use to display special slots indicating non-working hours in different Scheduler views?
- How do I configure the Scheduler to show non-working hours using the
SpecialSlots
feature?
Solution
To display non-working hours in the Telerik Scheduler for .NET MAUI, leverage the SpecialSlots
feature. This solution involves configuring the Scheduler in the XAML, setting up the ViewModel
to define non-working hours. Follow the steps below to achieve this.
1. Define the Scheduler in XAML with the SpecialSlotsSource
property for each view to bind to the non-working hours collection.
2. Define the ViewModel
to include a collection of appointments and non-working hours.
The non-working hours are defined as special slots with a recurrence pattern to repeat weekly.
3. Set the binding context of your page to the ViewModel
to ensure the Scheduler is bound to the appropriate data.
By following these steps, the Telerik Scheduler for .NET MAUI will display non-working hours as specified in the ViewModel
, across day view, week view, and multi day view definitions. This approach effectively utilizes the SpecialSlots feature to highlight non-working hours, enhancing the scheduler's functionality and user experience.