c# - LoadCompleted event in WPF WebBrowser is not working -


i have wpf webbrowser control.

<webbrowser name="wbmap"></webbrowser> 

in code behind, calling function in constructor setting navigation path , calling script in loadcompleted event.

private void loadmap() {     if (designerproperties.getisindesignmode(this)) return;     //get application execution path     string appdir = system.io.path.getdirectoryname(appdomain.currentdomain.basedirectory);     //combine application execution path map file name     string mappath = system.io.path.combine(appdir, "map.html");     //navigate browser above path     wbmap.navigate(mappath);     wbmap.loadcompleted += wbmap_loadcompleted;          }  void wbmap_loadcompleted(object sender, system.windows.navigation.navigationeventargs e) {     wbmap.invokescript("setlocation", "red"); } 

this javascript function set default location on google map. when invoking in loadcompleted event, cannot see marker. whereas, when put button , add in button.click event, location setting. how should invoke function?


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -