public void AddTab(string url, bool forceWebView = false) { var tab = new WebViewContentViewModel(url, this, forceWebView); WebViewTabs.Add(tab); SelectedTab = tab; }
public void RemoveTab(WebViewContentViewModel vm) { if (WebViewTabs.Count == 1) { Home(); return; } vm.WebBrowser.Dispose(); WebViewTabs.Remove(vm); SelectedTab = WebViewTabs.First(); }
public void NextTab() { var index = WebViewTabs.IndexOf(SelectedTab); if (WebViewTabs.Count - 1 == index) { SelectedTab = WebViewTabs[0]; } else { SelectedTab = WebViewTabs[index + 1]; } }
public void PrevTab() { var index = WebViewTabs.IndexOf(SelectedTab); if (index == 0) { SelectedTab = WebViewTabs[WebViewTabs.Count - 1]; } else { SelectedTab = WebViewTabs[index - 1]; } }