Hello,
how can I save recurring elements? I know that when I create a recurrence, occurences of the root items are made. But they are not in my appointment collection along the others. Thats possibly due to the nature of the occurence, since it is not a variance. However, I need the appointments, as soon as I am creating the reccurence, to save them in my database.
Thanks in advance
Hello tegos,
Thank you for your post!
You are correct that this behavior is due to the nature of the occurrence. The recurrence of an appointment exists on a single, "root activity", instance. I would recommend that to get the recurrent appointments in your XamSchedule that you use the Recurrence property that you have assigned to those appointments and calculate the dates that the following appointments will fall on. From there, you can create an appointment for each of those dates and save them back to your database without needing to add them to your XamSchedule's appointment collection.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for your answer Andrew. I thought about something similar. The problem here is that I can't use the xamSchedule recurring appointment functionalities, like editing the series or the single element, or even see that it is a recurring element on the element itself. I'm pretty sure I can create appointments, as I'm saving a recurrent property to a single appointment. The problem would be, when I will load the appointments from my database, I will have the one appointment (which has the recurrent property set) that will appear throughout my series, and then there will be "my" appointments, I created, along the ones that the xamSchedule is making due to the recurrent property from the one appointment.
Any thoughts about that one?
Thank you for your response.
To only load the recurrent appointment into your XamSchedule, I have a couple of recommendations. The first is to load the appointments that you create based on the Recurrence into a separate collection, rather than loading them into the collection you are using for the AppointmentItemsSource of the DataConnector that you are using for the XamSchedule.
If this is not an option for you, my alternative recommendation would be to create a custom object that derives from Appointment for your appointments, which would include a property that would allow you to decide whether or not to show it. Then, you could create a style for AppointmentPresenter, and since the AppointmentPresenter's data context is the Appointment itself, you could use a DataTrigger to bind to this new property. If it is of a value meaning the Appointment should be hidden, the DataTrigger's Setter could be for the Visibility property and you could hide the extra Appointments that way.