WPF 主题

WPF 切换主题

            string packUri = String.Format(@"/WpfControlLibrary1;component/Dictionary1.xaml");
            ResourceDictionary rd = Application.LoadComponent(new Uri(packUri, UriKind.Relative)) as ResourceDictionary;
            this.Resources.MergedDictionaries.Clear();
            this.Resources.MergedDictionaries.Add(rd);
//Application.Current.Resources.MergedDictionaries.Clear();
            //Application.Current.Resources.MergedDictionaries.Add(rd);

1、一个主题

 <ResourceDictionary Source="/PresentationFramework.Royale;V3.0.0.0;31bf3856ad364e35;component\themes\royale.normalcolor.xaml" />


参考:

http://download.csdn.net/detail/leogle_reloaded/3683771

原文地址:https://www.cnblogs.com/sshoub/p/2521294.html