<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="资源字典名.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
然后在后台指定即可。
控件名.Style = Resources["样式的Key"] as Style
只要在App.xaml里面添加字典的时候按先后顺序就可以了
<Application.Resources><ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Skin/BrushResources.xaml"/>
<ResourceDictionary Source="Skin/ImageResources.xaml"/>
<ResourceDictionary Source="Skin/AppResources.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
如上述代码所示,AppResources.xaml里面用到BrushResources.xaml里面的资源
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)