void BrowserNavStateChanged(object sender, NavStateChangedEventArgs e) { string navStatus = String.Format("Back ({0}) : Forward ({1}) : Reload ({2}) : Loading({3})", e.CanGoBack, e.CanGoForward, e.CanReload, e.IsLoading); LogMessage("NAVSTATE CHANGED: " + navStatus); }
/// <summary> /// Is called on change of browser load state and notifies the statusbar /// to say 'Loading...' or 'Loading done.' /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BrowserNavStateChanged(object sender, NavStateChangedEventArgs e) { // Do this on the UI thread since it otherwise throws an exception ... Dispatcher.BeginInvoke ( new Action(() => { Status.Text = e.CanReload ? "Loading done." : "Loading..."; } ), DispatcherPriority.Background); }
private void Cwb_NavStateChanged(object sender, CefSharp.NavStateChangedEventArgs e) { try { if (e.IsLoading) { lblStatusText.Text = "Loading"; } } catch (Exception) { throw; } }
private void OnBrowserLoadingStateChanged(object sender, NavStateChangedEventArgs args) { if (!args.IsLoading) { Debug.WriteLine("Loading Done"); webBrowser1.EvaluateScriptAsync("(function() {window.onload = function() {" + "document.querySelectorAll('.gb_rb.gb_Ta.gb_r')[0].setAttribute('style', 'position: relative;top: -500px;');" + "document.querySelectorAll('.gb_ga.gb_Ta.gb_r.gb_ma.gb_ja')[0].setAttribute('style', 'position: relative;top: -500px;');" + "}})()"); } }
private void OnBrowserNavStateChanged(object sender, NavStateChangedEventArgs args) { //this.Invoke(() => SetIsLoading(!args.CanReload)); }