Search code examples
cordovawindows-phone-8cordova-pluginshybrid-mobile-app

Can anybody explain in detail for WP -> this.CordovaView.Browser.LoadCompleted += Browser_LoadCompleted;?


For hybrid cordova Windows Phone application this.CordovaView.Browser.LoadCompleted += Browser_LoadCompleted; code is used. Can anybody explain this in detail?


Solution

  • LoadCompleted event is an event, which is fired when the Browser control is loaded in the view.

     this.CordovaView.Browser.LoadCompleted += Browser_LoadCompleted
    

    Here, you are attaching a listener to LoadCompleted event, so whenever the browser control will be loaded in view, the event LoadCompleted will get fired, which will eventually call your method Browser_LoadCompleted.

    Apart from this event, whenever you try to navigate a url, the default webBrowser control will fire following event.

    webBrowserControl.Navigated += WebPageLoaded;
    webBrowserControl.NavigationFailed += WebPageLoadFailed;
    webBrowserControl.Navigating += WhileNavigating;
    

    Navigating event is fired when the browser starts navigation and depending upon whether the navigation was a success or not, either navigated or NavigationFailed event will be fired.