I am using Visual Studio Express 2010 (C#). This is a single-threaded application with a couple of classes. The progress bar is in the main window and when the operation begins, in a separate class, at certain discrete times, I would like to update the progress bar. It's not a smooth operation. Perhaps there will be 20 steps, or 100. So when each one is finished I would like to notify the progress bar in the main window to update one step. All the examples I see are for callbacks and mulitithreaed examples. To me this seems very simple.
The main work is in a for each loop and when each section is done, I can make the progress bar update calll back to the main window.
I tried creating a BackgroundWorker object but then I need to have a reference in the worker class to my main class (which is not the App class) and when the code attempts to instantiate it I get an error that the calling class is not [STA]. The app class (by default for WPF) is the [STA]. So I'm not sure what to do now.