<Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Resource/ucWindowDictionary.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources>
控件名.Style = Resources["样式的Key"] as Style;
转载于:https://www.cnblogs.com/linji/archive/2012/11/13/2768082.html