public NavigationBarControl() { InitializeComponent(); // Handle visibility/invisibility of settings menu this.mainGrid.MouseLeftButtonDown += (object obj, MouseButtonEventArgs e) => this.MakeSettingsMenuInvisible(); this.settingsBtn.MouseLeftButtonUp += (object obj, MouseButtonEventArgs e) => this.MakeSettingsMenuVisible(); // Download page loading animation this.downloadBtn.MouseEnter += (object obj, MouseEventArgs e) => this.loadingWebpageControl.Visibility = Visibility.Visible; this.downloadBtn.MouseLeave += (object obj, MouseEventArgs e) => this.loadingWebpageControl.Visibility = Visibility.Hidden; // Download button animation var converter = new ImageSourceConverter(); this.downloadBtn.MouseEnter += (object obj, MouseEventArgs e) => { this.downloadImage.Source = (ImageSource)converter.ConvertFromString((string)this.FindResource("greenDownloadSource")); }; this.downloadBtn.MouseLeave += (object obj, MouseEventArgs e) => { this.downloadImage.Source = (ImageSource)converter.ConvertFromString((string)this.FindResource("downloadSource")); }; // Handle theme changing (Application.Current as App).ThemeChanged += (object obj, ThemeChangedEventArgs e) => { OrganicUtility.UpdateImages(this.mainGrid); }; Application.Current.Activated += (object obj, EventArgs e) => OrganicUtility.UpdateImages(this.mainGrid); }
public PreferencesWindow() { InitializeComponent(); // Mention that the window is running IsRunning = true; PreferencesWindow.CurrentRunningWindow = this; this.WindowStartupLocation = WindowStartupLocation.CenterScreen; // Handle theme changing (Application.Current as App).ThemeChanged += (object obj, ThemeChangedEventArgs e) => { OrganicUtility.UpdateImages(this.mainLayout); }; Application.Current.Activated += (object obj, EventArgs e) => OrganicUtility.UpdateImages(this.mainLayout); // Fill the preferences from the usersettings file UserSettings settings = UserSettings.Load(); this.homePage.Value = settings.HomePage; this.newTabPage.Value = settings.NewTabPage; this.darkRadioButton.IsChecked = settings.Theme == Theme.Dark; this.lightRadioButton.IsChecked = settings.Theme == Theme.Light; this.autoRadioButton.IsChecked = settings.Theme == Theme.Auto; }
public WindowManagementControl() { InitializeComponent(); // Handle theme changing (Application.Current as App).ThemeChanged += (object obj, ThemeChangedEventArgs e) => { OrganicUtility.UpdateImages(this.mainLayout); }; Application.Current.Activated += (object obj, EventArgs e) => OrganicUtility.UpdateImages(this.mainLayout); }
public event EventHandler TabClosed; // Event for closing a tab public BrowserTabControl() { InitializeComponent(); this.tabItems = new List <TabItem>(); this.tabControl.SizeChanged += this.TabControlSizeChangedHandler; // Margin the add new tab button this.addNewTabButton.Margin = this.AddNewTabMargin; // Handle theme changing (Application.Current as App).ThemeChanged += (object obj, ThemeChangedEventArgs e) => { OrganicUtility.UpdateImages(this.mainGrid); }; Application.Current.Activated += (object obj, EventArgs e) => OrganicUtility.UpdateImages(this.mainGrid); }
} // The current running window public LibraryWindow() { InitializeComponent(); // Mention that the window is running IsRunning = true; LibraryWindow.CurrentRunningWindow = this; // Insert all the saved pages this.InsertAllSavedPages(); // Handle theme changing (Application.Current as App).ThemeChanged += (object obj, ThemeChangedEventArgs e) => { OrganicUtility.UpdateImages(this.mainGrid); }; Application.Current.Activated += (object obj, EventArgs e) => OrganicUtility.UpdateImages(this.mainGrid); }