I have looked around but I am having difficulty finding a way to implement the following:
I have a WPF application with has a web browser control. I have a file saved on disk, and I am using the Navigate method to load the file.
I have an event handler attached to the web browser LoadCompleted event, and this works.
However, pages can take a long time to load. I want to display a progress bar (ideally in a status bar, but a new window is okay), but I can't find anyway to do this.
Every thing I have tried (background workers, threads) all say that the calling thread must be STA, and it seems that the progress bar, being a UI element, can only be updated on the UI thread - which is blocked by the web browser control during rendering of a page.
Alternatively is there a way to run the web browser control in a new thread? I am guessing not as this is also a UI element.
Any help would be appreciated.
p.s. The progress bar is a simple indeterminate bar; I am not trying to update the status - just display whilst a page is being loaded.