/// <summary> /// Applies a new theme based on the changed selection in the input element. /// </summary> /// <param name="ts"></param> public void ApplyTheme(FrameworkElement fe, string themeName) { if (themeName != null) { IsEnabled = false; try { var settings = GetService <ISettingsManager>(); // add the default themes Color AccentColor = ThemeViewModel.GetCurrentAccentColor(settings); GetService <IAppearanceManager>().SetTheme(settings.Themes, themeName, AccentColor); ThemeDefinitionViewModel o; _ListOfThemes.TryGetValue(themeName, out o); SelectedTheme = o; } catch { } finally { IsEnabled = true; } } }
/// <summary> /// Hidden standard constructor /// </summary> protected AppViewModel() : base() { _AppTheme = new ThemeViewModel(); }