How to create monthly recurrence appointments in WPF Scheduler (Calendar)?
Add the monthly recurrence appointment to the SfScheduler with the help of RecurrenceRule.
Please refer to the user guide documentation for the recurrence property and the purpose of WPF Scheduler.
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 Monthly on 15th",
};
scheduleAppointment.RecurrenceRule = "FREQ=MONTHLY;BYMONTHDAY=15;INTERVAL=1;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 ScheduleAppointmentCollection to Scheduler.
<syncfusion:SfScheduler x:Name="Schedule"
FirstDayOfWeek="Monday"
ViewType="Month"
ItemsSource="{Binding ScheduleAppointmentCollection}">
<syncfusion:SfScheduler.AppointmentMapping>
<syncfusion:AppointmentMapping StartTime="From"
EndTime="To"
Subject="EventName"
/>
</syncfusion:SfScheduler.AppointmentMapping>
</syncfusion:SfScheduler>
Hope you enjoyed learning about how to create monthly recurrence appointments in WPF Scheduler (Calendar).
You can refer to our WPF Scheduler feature tour page to learn about its other groundbreaking feature representations. You can explore our WPF Scheduler documentation to understand how to present and manipulate data.
For current customers, you can check out our Angular components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our Angular Diagram and other Angular components.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!