private void ClearHIstoryButton_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show("Вы действительно хотите очистить историю???", "Очистить историю", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { BrowserL.GEtInstatce().History.Clear(); } }
public MainWindow() { InitializeComponent(); Browser.Source = new Uri("https://www.google.com.ua/"); ResourceDictionary resourceDict = Application.LoadComponent(new Uri(BrowserL.GEtInstatce().CurrentTheme, UriKind.Relative)) as ResourceDictionary; Application.Current.Resources.MergedDictionaries.Add(resourceDict); }
//for write history private void Browsernavigated(object sender, NavigationEventArgs e) { if (BrowserL.GEtInstatce().IsSaveHistory) { string URL = ((WebBrowser)sender).Source.ToString(); BrowserL.GEtInstatce().AddHistory(new History(URL, GetTitle())); } ((TabItem)TabControls.Items[TabControls.SelectedIndex]).Header = GetTitle(); }
private void StyleComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { // BrowserL.GEtInstatce().CurrentTheme = ((ComboBoxItem)StyleComboBox.SelectedItem).Content.ToString(); BrowserL.GEtInstatce().CurrentTheme = ((string)StyleComboBox.SelectedItem); ResourceDictionary resourceDict = Application.LoadComponent(new Uri(BrowserL.GEtInstatce().CurrentTheme, UriKind.Relative)) as ResourceDictionary; // очищаем коллекцию ресурсов приложения // добавляем загруженный словарь ресурсов Application.Current.Resources.MergedDictionaries.Add(resourceDict); }
private void OK_Click(object sender, RoutedEventArgs e) { BrowserL.GEtInstatce().AddBookmarks(new Bookmark(this.URLTB.Text, NameTB.Text)); MessageBox.Show("Закладка добавленна"); this.Close(); }
public SettingWindow() { InitializeComponent(); this.StyleComboBox.SelectedIndex = BrowserL.GEtInstatce().styleList.IndexOf(BrowserL.GEtInstatce().CurrentTheme.Replace(@"Themes/", String.Empty).Replace(".xaml", String.Empty)); }