Пример #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;
                }
            }
        }
 /// <summary>
 /// Hidden standard constructor
 /// </summary>
 protected AppViewModel()
 {
     _AppTheme = new ThemeViewModel();
     _demo     = new DocumentRootViewModel();
 }
Пример #3
0
 /// <summary>
 /// Hidden standard constructor
 /// </summary>
 protected AppViewModel()
 {
     _AppTheme = new ThemeViewModel();
     _demo     = new ThemedDocumentViewModel(new HighLightingManagerAdapter(GetService <IThemedHighlightingManager>()));
 }
Пример #4
0
 /// <summary>
 /// Hidden standard constructor
 /// </summary>
 protected AppViewModel()
 {
     _AppTheme = new ThemeViewModel();
     _demo     = new DemoViewModel();
 }
 /// <summary>
 /// Hidden standard constructor
 /// </summary>
 protected AppViewModel()
 {
     _AppTheme = new ThemeViewModel();
     _demo     = new DocumentRootViewModel(GetService <IThemedHighlightingManager>());
 }