开发者

How to show a IsBusy flag when I have a collection of UI intensiv tasks each on its background thread?

I have a DataGrid with a Column datatemplated with a RichTExtBox. If I bind 10 objects with RTF data that results in 10 RichTextBoxes.

For 1 DINA4 page of RTF a RTBox needs 200 ms to do textrange.Load(data).

Now I have a UI freeze of 2000 ms when I switch my Calendar views. Thats ok If I could show an

IsBusy Adorner, but I have a collection of RTBoxes how can I do this?

I could run each UI task on a background thread and use the Dispatcher to update the UI. But

still then I need a loading ado开发者_运维问答rner/progress bar. All the data comes very fast in 100-200 ms

from my database in async manner. But how would you solve that special Loading Adorner problem?


Why can't you run all of the background work in a single BackgroundWorker? You could set the loading adorner/progress bar immediately after starting the BackgroundWorker and you could remove the loading adorner/progress bar in the RunWorkerCompleted method. The ProgressChanged method can be used to keep the loading adorner/progress bar updated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜