public void GoForward() => r_Browser.GoForward();
public void GoForward() { view.GoForward(); }
public KanColleBrowser() { InitializeComponent(); WebBrowser.Navigated += (_, __) => ApplyZoomFactor(zoomFactor); WebBrowser.LoadCompleted += (_, __) => LockFlash(IsFlashLocked); SetSilence(true); SetAllowDrop(false); btnBack.Click += (_, __) => WebBrowser.GoBack(); btnFoward.Click += (_, __) => WebBrowser.GoForward(); GotoUrlCommand = new DelegateCommand(() => { if (!txtAddress.Text.Contains(":")) { txtAddress.Text = "http://" + txtAddress.Text; } try { WebBrowser.Navigate(txtAddress.Text); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); } }); btnRefresh.Click += (_, __) => WebBrowser.Navigate(WebBrowser.Source); btnBackToGame.Click += (_, __) => WebBrowser.Navigate(Properties.Settings.Default.GameUrl); btnStop.Click += (_, __) => Stop(); WebBrowser.Navigating += (_, e) => { txtAddress.Text = e.Uri.AbsoluteUri; btnBack.IsEnabled = WebBrowser.CanGoBack; btnFoward.IsEnabled = WebBrowser.CanGoForward; styleSheet = null; UpdateSize(false); }; btnScreenShot.Click += (_, __) => TakeScreenShot(Config.Current.GenerateScreenShotFileName()); btnCleanCache.Click += async(sender, _) => { var button = sender as Button; button.IsEnabled = false; if (MessageBox.Show(StringTable.CleanCache_Alert, "", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes) { if (await WinInetHelper.DeleteInternetCacheAsync()) { MessageBox.Show(StringTable.CleanCache_Success); } else { MessageBox.Show(StringTable.CleanCache_Fail); } } button.IsEnabled = true; }; this.Loaded += (_, __) => { if (firstLoad && Officer.Staff.IsStarted) { WebBrowser.Navigate(Properties.Settings.Default.GameUrl); firstLoad = false; } }; }