I am responding to the System.Windows.WebBrowser.DocumentComplete event in my application. However this event fires every time an ajax call completes on the page. I would like to know when the document is ready. Meaning when all calls out have returned. Any ideas?
void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
//Can fire many times if page has async calls.
}
After much searching, trail and error I decided to add a manual delay. I simple spin up a worker thread and then put this tread to sleep for a couple of seconds. This allows the main ui to work while adding the needed delay.