代碼中引用資源字典中的樣式?
首先在頁(yè)面里合并資源字典,放在<Window.Resources>或<Page.Resources><ResourceDictionary><ResourceDictionary.MergedDictionaries><ResourceDictionarySource="資源字典名.xaml"/></ResourceDictionary.MergedDictionaries></ResourceDictionary>然后在后臺(tái)指定即可。控件名.Style=Resources["樣式的Key"]asStyle;