I am trying to invoke invokescript in WPF when the application is just loading. I passed the parameter that I get from the database to invokescript after loading WPF. However, I continue to receive the Unknown Name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)). I downloaded a web browser control and added navigation event control.
Uri uri = new Uri(@"pack://application:,,,/Navigator.htm");
Stream source = Application.GetContentStream(uri).Stream;
wbNavigator.NavigateToStream(source);
wbNavigator.Navigated +=new NavigatedEventHandler(wbNavigator_Navigated);
I also tried Loaded () event, LoadCompleted (), but none of them work. I did some research, and most of them say, because the webbrowser control is not yet initialized. I even try to invoke invokescript using a separate thread and use sleep () for a few seconds, but it still does not work.
There should be a way to call invokescript () when WPF has just booted. I can make it work if I press the button invoking invokescript if the WPF application is already loaded.
source
share