首页 文章
  • 9 votes
     answers
     views

    WPF StaticResource工作,DynamicResource没有

    我一直在尝试一天,无济于事,在主题中创建一堆画笔,然后在自定义控件中使用DynamicResource . 我做的是这样的: 创建包含样式(作品)的主题generic.xaml 添加字典以在generic.xaml中合并以包含应用程序中使用的画笔(作品) make brush有ComponentResourceKey键(有效) make control使用画笔作为静态资源(作品) ...
  • 2 votes
     answers
     views

    让ComponentResourceKey工作?

    我正在构建一个包含多个程序集的WPF应用程序,我想在它们之间共享一个资源字典 . 这需要ComponentResourceKey . 我已经构建了一个小型演示来测试CRK,我似乎无法让它工作 . 我的演示有两个项目,一个名为Demo的WPF项目和一个名为Common的DLL . Common项目有一个名为Themes的文件夹 . 它包含我的资源字典generic.xaml . 这是资源字典的文本...
  • 3 votes
     answers
     views

    ComponentResourceKey为DynamicResource问题

    我看到使用ComponentResourceKey的一些意外行为 . 问题出现了,因为我使用的是SystemColors类中使用的名称 . 请考虑以下代码: 首先,我将一个ComponentResourceKey暴露在一个静态属性中: public enum ColorKeys { ControlColor } public class MyColors { public sta...

热门问题