wpf - Display a busy indicator while waiting for an initialization of a usercontrol -


my app needs load usercontrol in mainwindow on startup. initialization of usercontrol slow. (not because of loading business data, separate ui business layer)

want while waiting initialization of usercontrol, busy indicator appear , disappear when initialization of usercontrol finished.

right have isbusy property in mainviewmodel , databind busyindicator in mainwindow.

the child usercontrol displayed via contentcontrol.

presenter.content = new childusercontrol();  //presenter contentcontrol in mainwindow 

however, how run both initialization , display of busy indicator simultaneously? seems need different threads handle issue.

however, running initialization on different thread while letting main ui thread display busy indicator not work, since child control in thread cannot placed within parent control, in case mainwindow.

ideas on that?

i have implemented myself. namely had scenario had xps document loading(it slow) , had implement spinner("busy indicator"). didn't work because on same thread.

now dwayne come clever way how multithread this, , worked. http://blogs.msdn.com/b/dwayneneed/archive/2007/04/26/multithreaded-ui-hostvisual.aspx


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -