Articles in this section

How to create weekly recurrence appointments in WinUI Scheduler (Calendar)

Add the weekly recurrence appointment to the WinUI SfScheduler with the help of RecurrenceRule.

Please refer to the user guide documentation for the recurrence property and its purpose.

C#

Create the recurrence appointment in the ViewModel with the help of RecurrenceRule.

public class SchedulerViewModel : INotifyPropertyChanged
{
    private ScheduleAppointmentCollection scheduleAppointmentCollection;
    public SchedulerViewModel()
    {
        this.ScheduleAppointmentCollection = new ScheduleAppointmentCollection();
        var scheduleAppointment = new ScheduleAppointment()
        {
            Id = 1,
            StartTime = DateTime.Today.AddHours(11),
            EndTime = DateTime.Today.AddHours(12),
            Subject = "Occurs weekly On Monday and Wednesday",
        };
        scheduleAppointment.RecurrenceRule = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE;COUNT=10";
        ScheduleAppointmentCollection.Add(scheduleAppointment);
    }
    public ScheduleAppointmentCollection ScheduleAppointmentCollection
    {
        get
        {
            return this.scheduleAppointmentCollection;
        }
        set
        {
            this.scheduleAppointmentCollection = value;
            this.RaiseOnPropertyChanged("ScheduleAppointmentCollection");
        }
    }
    public event PropertyChangedEventHandler PropertyChanged;
    private void RaiseOnPropertyChanged(string propertyName)
    {
        this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

XAML

Binding the ScheduleAppointmentCollection to the Scheduler.

<scheduler:SfScheduler x:Name="Schedule"
                    FirstDayOfWeek="Monday"
                    ViewType="Week"
                    ItemsSource="{Binding ScheduleAppointmentCollection}">
</scheduler:SfScheduler>

Create weekly recurrence appointments in the WinUI Scheduler 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied