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" />
参考: