private void OnBrowserNavStateChanged(object sender, NavStateChangedEventArgs args) { SetCanGoBack(args.CanGoBack); SetCanGoForward(args.CanGoForward); this.InvokeOnUiThreadIfRequired(() => SetIsLoading(!args.CanReload)); }
/// <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> void browser_NavStateChanged(object sender, NavStateChangedEventArgs e) { if (e == null) { return; } if (e.CanReload == false) { // Do this on the UI thread since it otherwise throws an exception ... Application.Current.Dispatcher.BeginInvoke ( new Action(() => { this.Status.Text = "Loading..."; } ), DispatcherPriority.Background); } else { // Do this on the UI thread since it otherwise throws an exception ... Application.Current.Dispatcher.BeginInvoke ( new Action(() => { this.Status.Text = "Loading done."; } ), DispatcherPriority.Background); } }
private void OnNavStateChanged(object sender, NavStateChangedEventArgs args) { if (NavStateChangedUiThreadSafe != null) { this.InvokeOnUiThreadIfRequired(() => NavStateChangedUiThreadSafe(sender, args)); } }
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); }
/// <summary> /// 跳转后的事件 /// </summary> private void OnBrowserNavStateChanged(object sender, NavStateChangedEventArgs args) { Dispatcher.Invoke(new Action(() => { BackButton.IsEnabled = args.CanGoBack; ForwardButton.IsEnabled = args.CanGoForward; RefreshButton.IsEnabled = args.CanReload; var browserTabViewModel = DataContext as BrowserTabViewModel; if (browserTabViewModel != null) { browserTabViewModel.IsLoading = args.IsLoading; } })); }
void browser_NavStateChanged(object sender, NavStateChangedEventArgs e) { Write("NavStateChanged."); }
private void OnBrowserNavStateChanged(object sender, NavStateChangedEventArgs args) { //this.Invoke(() => SetIsLoading(!args.CanReload)); }
private void OnBrowserNavStateChanged(object sender, NavStateChangedEventArgs args) { SetCanGoBack(args.CanGoBack); //SetCanGoForward(args.CanGoForward); }