How to create the recurring time regions for week view in WinUI Scheduler (Calendar)
Create recurring time regions in the SfScheduler with the help of the RecurrenceRule property for the SpecialTimeRegions.
Please refer to the user guide documentation of the RecurrenceRule property for the SpecialTimeRegion.
C#
Create new recurring time regions for the SpecialTimeRegions property of DaysViewSettings in the SfSchedule.
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
Scheduler.DaysViewSettings.SpecialTimeRegions.Add(new SpecialTimeRegion
{
StartTime = DateTime.Today.AddHours(13),
EndTime = DateTime.Today.AddHours(14),
Text = "Lunch",
CanEdit = false,
Background = new SolidColorBrush(Colors.Black),
Foreground = new SolidColorBrush(Colors.White),
CanMergeAdjacentRegions = true,
RecurrenceRule = "FREQ=DAILY;INTERVAL=1"
});
}
}
