将 WPF 主题强制应用到 .net 4.0 中的应用程序
我试图通过使用以下语句强制 WPF 应用程序使用经典 Windows 主题
<ResourceDictionary Source="/PresentationFramework.Classic;V3.0.0.0;31bf3856ad364e35;component/themes/classic.xaml" />
这曾经在 .net 3.5 中正常工作。但是一旦我切换到.net 4.0,这似乎就不起作用了。谁能告诉我如何让它在 4.0 框架中工作。我尝试用PresentationFramework.Classic.dll的值替换版本号和公钥令牌,但我的努力变得徒劳......任何人都可以给我建议吗?
I was trying to force the WPF application to use the classic windows theme by using the following statement
<ResourceDictionary Source="/PresentationFramework.Classic;V3.0.0.0;31bf3856ad364e35;component/themes/classic.xaml" />
This used to work fine with .net 3.5. But once i switched to .net 4.0 this doesn't seem to work. Can anyone tell me how i can get this working in 4.0 framework. I tried replacing the version numbers and the public key tokens with the PresentationFramework.Classic.dll's values but my efforts turned futile... Can anyone suggest me something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要设置版本号。您可以简单地使用它,就像
对于经典:
对于 Royale:
在引用程序集后,还必须将“复制本地”属性设置为 true。默认情况下我只有 Aero2,我将其替换为 Classic,但直到我将 copy local 设置为 true 后它才起作用。
You don't need to set the version number. You can simply use it like
For Classic:
For Royale:
The "Copy Local" property must also be set to true on the assembly after it's referenced. By default I had only Aero2, I replaced it with Classic, but it didn't work until I set copy local to true.