WPF中调用资源字典的方法

  <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resource/ucWindowDictionary.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

然后在后台指定即可
控件名.Style = Resources["样式的Key"] as Style;
posted @ 2012-11-13 15:16  Jerome's Blog  阅读(1435)  评论(0编辑  收藏  举报