Hi
I have the following problem:
1) I create a recurring appointment
2) I'm changing a single date of recurring appointment
Now is not the Added but the Changed Event fired for the variance.
That is the correct behavior. By changing a property of an occurrence you are not really creating a new activity instance - you are just modifying/changing one occurrence of a recurring activity. If you wanted to know if an activity is becoming a variance then you could compare the IsVariance of the Activity to that of OriginalActivityData.
Thanks for the quick reply.
Then I do the following question:
I have to save variancen in DB otherwise they will not shown after restart the application.Per variance (edit / delete) an entry in the DB so I have understood it.
I use a Binding (MVVM / ObservableCollection / Entity Framework ...).
how can I recognize a new variance?IsVariance is always true ... creating or amending a variance may have been changed againIsAddNew = True in both cases (create / change)
maybe you have a small example on this subject ...
Thank you.
Thanks for your help
Well if I understand what you are doing then you would need to look at the ActivityChanging event and if the e.Activity.IsOccurrence is true and the e.OriginalActivityData.IsVariance is false, then you can know that the activity being modified was an unmodified occurrence and therefore you will need to store his information.
If I understand correctly:1) ... the new App on the events of the collection2) ... the changes on the events of the Data ManagerIn the way I had it been implemented yet ... but I thought that there must be a uniform solution alone on the events of the Data Manager.In short, it is not possible only with the Data Manger?Thank you
I'm not sure I follow your question. If you are binding the ListScheduleDataConnector then it will create an item in the list for the variance when the occurrence is first changed to be a variance just as it would create an item when you create a new non-recurring activity. So while you will not get ActivityAdd(ing|ed) events of the XamScheduleDataManager, you will still get an Add collection change notification on your observablecollection that is used as the AppointmentItemsSource. Also, while IsOccurrence should always be true for occurrences (whether they are variances or not) of a recurring activity, IsVariance should only be true for occurrences that have been changed.
sorry
IsAddNew = False in both cases (create / change)