/// <summary> /// Load the saved theme and accent /// </summary> public void LoadSavedTheme() { // Get the saved theme and accent AppThemeMenuData savedTheme = AppThemes.Where(t => t.Name == Properties.Settings.Default.AppTheme).FirstOrDefault(); AccentColorMenuData savedAccent = AccentColors.Where(a => a.Name == Properties.Settings.Default.AppAccent).FirstOrDefault(); // Change to the saved theme and accent savedTheme?.ChangeAccentCommand.Execute(null); savedAccent?.ChangeAccentCommand.Execute(null); }
private void WindowThemeUserControl_Loaded(object sender, RoutedEventArgs e) { Window window = Window.GetWindow(this); window.Closing += window_Closing; // Get the saved theme and accent AppThemeMenuData savedTheme = AppThemes.Where(t => t.Name == Properties.Settings.Default.AppTheme).FirstOrDefault(); AccentColorMenuData savedAccent = AccentColors.Where(a => a.Name == Properties.Settings.Default.AppAccent).FirstOrDefault(); // Change to the saved theme and accent savedTheme?.ChangeAccentCommand.Execute(null); savedAccent?.ChangeAccentCommand.Execute(null); }