1
在應用程序中,我正在研究的一項要求是支持Windows主題(Aero,Classic,Luna)。WPF不使用主題資源
我有幾個自定義控件,我想尊重當前的主題。
我創建的主題文件夾,並放置
/themes/classic.xaml
/themes/luna.normalcolor.xaml
/themes/aero.normalcolor.xaml
/themes/generic.xaml
在包含我已經定義ThemeInfo自定義控件爲以下項目的AssemblyInfo.cs:
[assembly: ThemeInfo(
ResourceDictionaryLocation.SourceAssembly,
ResourceDictionaryLocation.SourceAssembly
)]
當我更改主題在Windows中,所有標準控件切換主題,但我的自定義控件拒絕從除generic.xaml之外的任何東西讀取
我在這裏丟失了什麼?
乾杯,我會記下你的觀點,並在有更多信息時回覆。 Sidenote,項目中的大寫字母實際上與您輸入的內容完全相同。 – ThomasAndersson 2011-03-10 18:22:01
我低頭對你的智慧。 Build action = Page爲我做了訣竅。 – ThomasAndersson 2011-03-10 18:29:45