首页 > 代码库 > WPF Mahapps.Metro 设置主题样式

WPF Mahapps.Metro 设置主题样式

 

        /// <summary>
        /// 设置App样式
        /// </summary>
        /// <param name="accentName">窗口标题栏样式</param>
        /// <param name="themeName">背景样式</param>
        private void ChangeTheme(string accentName, string themeName)
        {
            Accent expectedAccent = ThemeManager.Accents.First(x => x.Name == accentName); //"Blue"
            AppTheme expectedTheme = ThemeManager.GetAppTheme(themeName);  //"BaseDark"
            ThemeManager.ChangeAppStyle(Application.Current, expectedAccent, expectedTheme);
        }

 

WPF Mahapps.Metro 设置主题样式