Beispiel #1
0
        /// <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;
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Hidden standard constructor
 /// </summary>
 protected AppViewModel()
 {
     _AppTheme = new ThemeViewModel();
     _demo     = new DemoViewModel();
 }