Updating a progress bar while wpf data binding is taking place (in c#)

Posted by evan on Stack Overflow See other posts from Stack Overflow or by evan
Published on 2010-05-06T20:45:13Z Indexed on 2010/05/06 20:48 UTC
Read the original article Hit count: 913

Filed under:
|
|
|

I bind a large dataset to a WPF list box which can take a long time (more than ten seconds). While the the data is being bound I'd like to display a circular progress bar

I can't get the progress bar to show while the data binding is occurring, even though I am trying to do the binding in a backgroundworker. I tested it by making the first line of the backgroundworkd's dowork event a Thread.Sleep(5000) and sure enough the progress bar started spinning for that duration only to freeze while when the binding started.

Is this because both the databinding and the UI updating have to occur on the same thread? Any ideas on how to work around it?

Thanks for your help!!

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf