/// <summary> /// Standard Constructor /// </summary> public ThemeViewModel() { var settings = GetService <ISettingsManager>(); // add the default themes _ListOfThemes = new Dictionary <string, ThemeDefinitionViewModel>(); foreach (var item in settings.Themes.GetThemeInfos()) { _ListOfThemes.Add(item.DisplayName, new ThemeDefinitionViewModel(item)); } // Lets make sure there is a default _ListOfThemes.TryGetValue(GetService <IAppearanceManager>().GetDefaultTheme().DisplayName, out _DefaultTheme); // and something sensible is selected _SelectedTheme = _DefaultTheme; _SelectedTheme.IsSelected = true; }
/// <summary> /// Standard Constructor /// </summary> public ThemeViewModel() { var settings = GetService <ISettingsManager>(); // add the default themes _ListOfThemes = new Dictionary <string, ThemeDefinitionViewModel>(); var appearance = GetService <IAppearanceManager>(); // Go through all WPF Themes lazily initialized in AppLifeCycleViewModel // and make theme available in themes handling viewmodel foreach (var item in settings.Themes.GetThemeInfos()) { _ListOfThemes.Add(item.DisplayName, new ThemeDefinitionViewModel(item)); } var defaultTheme = appearance.GetDefaultTheme(); // Lets make sure there is a default _ListOfThemes.TryGetValue(defaultTheme.DisplayName, out _DefaultTheme); // and something sensible is selected _SelectedTheme = _DefaultTheme; _SelectedTheme.IsSelected = true; }