コード例 #1
0
        /// <summary>
        /// Responsible to produce the theme colors as per the settings selected by user.
        /// </summary>
        /// <returns></returns>
        public ThemeColorHolder GetThemeAscent()
        {
            string           selectedTheme    = Properties.Settings.Default.Theme;
            ThemeColorHolder themeColorHolder = new ThemeColorHolder();

            switch (selectedTheme)
            {
            case "Red":
                themeColorHolder.BackgroundColor = redDeep;
                themeColorHolder.ForegroundColor = redLight;
                break;

            case "Green":
                themeColorHolder.BackgroundColor = greenDeep;
                themeColorHolder.ForegroundColor = greenLight;
                break;

            case "Blue":
                themeColorHolder.BackgroundColor = blueDeep;
                themeColorHolder.ForegroundColor = blueLight;
                break;

            case "Grey":
                themeColorHolder.BackgroundColor = greyDeep;
                themeColorHolder.ForegroundColor = greyLight;
                break;

            case "Purple":
                themeColorHolder.BackgroundColor = purpleDeep;
                themeColorHolder.ForegroundColor = purpleLight;
                break;

            case "Orange":
                themeColorHolder.BackgroundColor = orangeDeep;
                themeColorHolder.ForegroundColor = orangeLight;
                break;

            default:
                themeColorHolder.BackgroundColor = greyDeep;
                themeColorHolder.ForegroundColor = greyLight;
                break;
            }

            return(themeColorHolder);
        }
コード例 #2
0
        private void SetupApplicationTheme()
        {
            ThemeColorHolder themeColors = this.iocContainer.Resolve <SettingManagementService>().GetThemeAscent();

            SetMainWindowElements(themeColors.ForegroundColor, themeColors.BackgroundColor);
        }