This tutorial shows how to programmatically create recurring items using MindFusion.Scheduling for Silverlight.
Follow steps 1 through 3 from the previous tutorial.
Set CurrentView to WeekRange, Date to Jan 1, 2010 and EndDate to Mar 1, 2010, respectively.
Create a new appointment in the page's constructor. To create the appointment, add the following lines of code after the call to InitializeComponent.
Note |
---|
Be sure to include both MindFusion.Scheduling and MindFusion.Scheduling.Silverlight namespaces via the using (Imports in Visual Basic) keyword in the beginning of the file. |
C# Copy Code |
---|
Appointment app = new Appointment(); |
Visual Basic Copy Code |
---|
Dim app As New Appointment() |
The code above creates a new appointment on 10th of January, 2010, starting at 2:00 PM and ending at 4:30 PM.
Now that the appointment is added to the schedule, create a Recurrence object that defines how the appointment recurs. The following code creates and initializes a new Recurrence object and associates it with the item. Append these lines to the main page's constructor.
C# Copy Code |
---|
Recurrence rec = new Recurrence(); |
Visual Basic Copy Code |
---|
Dim rec As New Recurrence() |
This fragment creates a new recurrence object that continues infinitely and repeats the appointment on Monday and Wednesday every two weeks.
Compile and run the application. The image below depicts what the application output would look like.