Files to look at:
- CustomObjects.cs (VB: CustomObjects.vb)
- Form1.cs (VB: Form1.vb)
Starting with version 15.2, we split layout calculation operations into several threads to improve the typical performance of a Scheduling application. Correspondingly, in a common scenario, the InitAppointmentImages event (as well as InitAppointmentDisplayText) can be raised from another thread than the one where the SchedulerControl instance was created. Accessing the SchedulerControl (SchedulerStorage) instance directly in the InitAppointmentImages event when the OptionsBehavior.UseAsyncMode property is true can result in "cross-thread" exceptions.
Correspondingly, to avoid the "cross-thread" issues in a scenario when the OptionsBehavior.UseAsyncMode property is true, you need to avoid direct accessing the SchedulerControl or SchedulerStorage instance in the mentioned event handlers.
To implement it, we recommend storing all the required information to calculate custom appointment images and the display text as custom appointment fields, to operate only with the current appointment instance without accessing an underlying source object.
This example demonstrates how it can be achieved.
(you will be redirected to DevExpress.com to submit your response)