we're using PropertyGrid (version 11.1.0545.1) within pure-WPF application that shows live video (live image from electron microscope in our case). Live video is done through Image & WriteableBitmap. WriteableBitmap back buffer is filled in on background thread. However, due to WPF limitations, WriteableBitmap has to be locked and unlocked on Dispatcher thread. This means that when Dispatcher thread is blocked for longer than frequency of video update, video image visibly staggers. Simply put, we have strict requirement on maximal time spent within one dispatch of Dispatcher thread.
That's where PropertyGrid comes in. Typical object set to PropertyGrid.SelectedObjects (some graphics on top of video image) has two categories (basic & advanced), one with 8 and second with 30 properties. Setting such object to PropertyGrid always cause video to stagger - PropertyGrid simply takes too much time to build its UI. When categories are initially collapsed, video staggers at the moment of expanding Advanced category (the one with 30 properties).
Is there any way to improve this user experience? I understand most of the work has to be done on Dispatcher thread - but maybe there's some way to divide work between multiple dispatches (so video update can take time in between)? Or do you have any other suggestion how to solve it? Are there any guidelines how to make property grid update as fast as possible? For example, can it be somehow "pre-built" and then just filled with values of particular object instance?
thanks for any help,