This video demonstrates how to use the ProgressBar control in WPF with a BackgroundWorker to show progress for a long running task.. Example Code: bitbucket.org/...
The example worked great, right up to the point where i tried to actually use it in the real world. As soon as I added some code to the Worker_DoWork method i get error: "The calling thread cannot access this object because a different thread owns it." The exception came when i tried to pull user input text from the UI.
My lengthy process is not as straight forward. I'm calling a function that runs through and does some processing. I'm seeing this error using your technique: An exception of type 'System.InvalidOperationException' occurred in WindowsBase.dll but was not handled in user code Additional information: The calling thread cannot access this object because a different thread owns it. occurred