WPF Statusbar Updates - help, I seem to be going round in circles
Posted
by David Ward
on Stack Overflow
See other posts from Stack Overflow
or by David Ward
Published on 2010-04-12T11:39:02Z
Indexed on
2010/04/12
11:43 UTC
Read the original article
Hit count: 433
wpf
|backgroundworker
I seem to be going round in circles.
I have a WPF application that has a main ribbon window with a status bar. When you navigate to a "view" a user control is displayed as the content of the main window.
The view has a ViewModel which handles retrieving data from the database and the View's datacontext is set to the ViewModel.
What I want is to have the lengthy operation (data retrieval) run on a background thread and whilst it is running the status in the main window to report appropriately. When the background task is complete, the status should revert back to "Ready" (much the same as Visual Studio).
How should I wire this together so that I can have the data access code separated out in the ViewModel whilst keeping a responsive UI?
I have tried using the BackgroundWorker is various places in the code and I still end up with an unresponsive UI.
© Stack Overflow or respective owner