WPF中调用资源字典的方法

原文链接:http://www.cnblogs.com/linji/archive/2012/11/13/2768082.html
  <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

上一篇:一个三本生的 进阶之路:6 年时间,从菜鸟到阿里 P7!


下一篇:WPF绘制渐变背景