Hello,
currently we are saving the appointment inside of our CustomAppointmentDialog.
ActivityOperationResult result = dlg.DataManager.EndEdit(dlg.Activity, true);
Appointment = result.Activity.DataItem as AppointmentInfo;
//DoStuffWithAppointment
dlg.UpdateDirtyStatus(false);
The problem is when I change something else, the dialog is dirty again and from my understanding the OnActivityChanging code will run again once we save in the dialog.
However, the DataItem from the ActivityChangingEventArgs for the "ActivityChanging" event does not have the values from the first time we saved and the DataItem is not known inside my main DataManager. Even when we changed it earlier with my method.
I hope you understand what I mean. It is kind of a complex program with database access, so it's not that easy to provide accessible code that you can run. However, if you can do live support, I'd be interested in that.
Best regards
Hi Tegos,
Not sure what your setup is like so this may not be helpful at all but have you implemented INotifyPropertyChanged on your AppointmentInfo class? If you are changing properties on there that are mapped to the Appointment class properties then once a property notification is detected the Appointment should update accordingly.
Hi Rob,
thank you for your answer. Yes of course I've implemented it. However that is not working.
So this is what I think what happens: When I edit a new appointment, it is in the appointment dialog as a "temporary record". And now when I save it manually (see code above), the record will still be the temporary record after saving. So it does not contain any of the data, that gets written into the record the first time we saved. Now when I save the appointment again (save & close) it won't have any of the changes that I made earlier with my manual save.
Hope you understand what I'm talking about.