Beispiel #1
0
        /// <summary>
        /// List all themes available in this component
        /// </summary>
        /// <returns></returns>
        private static ObservableCollection <ThemeVM> ListAllThemes(ThemesVM themes)
        {
            // Sort themes by their name before constructing collection of themes
            System.Collections.Generic.SortedDictionary <string, ThemeVM> s = new SortedDictionary <string, ThemeVM>();

            foreach (object t in Enum.GetValues(typeof(ThemesVM.EnTheme)))
            {
                s.Add(ThemesVM.ThemeNames[(int)t], new ThemeVM(themes, (ThemesVM.EnTheme)t, ThemesVM.ThemeNames[(int)t]));
            }

            ObservableCollection <ThemeVM> allThemes = new ObservableCollection <ThemeVM>();

            foreach (KeyValuePair <string, ThemeVM> t in s)
            {
                allThemes.Add(t.Value);
            }

            return(allThemes);
        }
Beispiel #2
0
 /// <summary>
 /// Constructor from parent reference to <seealso cref="ThemesVM"/>
 /// collection and <see cref="ThemesVM.EnTheme"/> enumeration entry.
 /// </summary>
 /// <param name="parentObject"></param>
 /// <param name="displayText"></param>
 /// <param name="t"></param>
 public ThemeVM(ThemesVM parentObject, ThemesVM.EnTheme t, string displayText)
 {
     this.mParent = parentObject;
     this.ThemeID = t;
     this.mText   = displayText;
 }
Beispiel #3
0
        /// <summary>
        /// Default constructor for collection of themes (application skins)
        /// from <seealso cref="ThemesVM.EnTheme"/> enumeration entry as theme
        /// to initialize to.
        /// </summary>
        /// <param name="thisCurrentTheme"></param>
        public ThemesVM(EnTheme thisCurrentTheme)
        {
            this.Themes = ThemesVM.ListAllThemes(this);

            this.mCurrentTheme = thisCurrentTheme; // Construct with this theme as current theme
        }
Beispiel #4
0
        /// <summary>
        /// Default constructor for collection of themes (application skins).
        /// </summary>
        public ThemesVM()
        {
            this.Themes = ThemesVM.ListAllThemes(this);

            this.mCurrentTheme = EnTheme.Aero; // Just select any theme as default
        }