在我正在处理的应用程序中,要求支持 Windows 主题(Aero、Classic、Luna)。
我有一些我想尊重当前主题的自定义控件。
我创建了主题文件夹并放置
/themes/classic.xaml
/themes/luna.normalcolor.xaml
/themes/aero.normalcolor.xaml
/themes/generic.xaml
在包含自定义控件的项目的 AssemblyInfo.cs 中,我将 ThemeInfo 定义如下:
[assembly: ThemeInfo(
ResourceDictionaryLocation.SourceAssembly,
ResourceDictionaryLocation.SourceAssembly
)]
当我在 Windows 中更改主题时,所有标准控件都会切换主题,但我的自定义控件拒绝读取除 generic.xaml 之外的任何内容
我在这里遗漏了什么明显的东西吗?