Saving changes from controls within Gantt Chart Light Library
We handle CollectionChanged and/or PropertyChanged events of items to save changes
made by the end user to the underlying data using controls within
Gantt Chart Light Library.
However, we have found that these events occur several times, and therefore they are not
appropriate for saving changes back to a server or database from inside the handler methods.
Is there an alternative?
You can use this workaround to resolve this issue:
- Handle the events but do not save changes to the server or database from the handler methods; instead, only create/start an internal Timer object (set up to raise its Tick event after a small constant time span value that at your choice); if the timer was already started before, you may want to stop it and restart it;
- Eventually, when the Timer.Tick event fires, stop the timer, and save the changes to the server or database. All subsequent change notification events generated by a single end user action should have been raised and be completed by that time, and therefore saving the changes wouldn't interfere much with user's actions in this case, increasing perfromance.