[英]Is there a way to make WPF application less “ugly” in Windows 10?
So, I just switched to Windows 10 and I noticed all my desktop WPF
applications are noticeably "uglier" than they where on Win7/Win8. 所以,我刚刚切换到Windows 10,我注意到我所有的桌面
WPF
应用程序都明显比在Win7 / Win8上更加“丑陋”。
I know this sounds subjective/pointless, but let me be more precise. 我知道这听起来很主观/毫无意义,但让我更加精确。 Here's some examples of objective degradation of the UI's usability/clarity:
以下是UI可用性/清晰度的客观降级的一些示例:
button
s do not get flattened (again, see image) button
不会变平(再次看图像) ListView
items are not highlighted on mouseOver ListView
项目不会在mouseOver上突出显示 ProgressBar
s have the "blue segments" pre-XP look ProgressBar
拥有XP前的“蓝色部分”外观 EDIT: 编辑:
After testing on another machine, turns out the problem had nothing to do with WPF or Windows. 在另一台机器上测试后,结果发现问题与WPF或Windows无关。
Just DON'T apply any tweaks for win10 you find on the internet to restore the coloring on windows borders. 只是不要对你在互联网上找到的win10应用任何调整来恢复Windows边框上的着色。 It messes up the WPF theme engine.
它弄乱了WPF主题引擎。
Sorry for wasting your time guys. 很抱歉浪费你的时间。
Well, I found out how to fix it (thanks to gix for pointing me in the right direction): 好吧,我发现了如何解决它(感谢gix指出我正确的方向):
First step: reference the PresentationFramework.Aero2
assembly in your project第一步:在项目中引用 PresentationFramework.Aero2
程序集Second step: add the following to your App.xaml
第二步:将以下内容添加到 App.xaml
<Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Aero2;component/themes/Aero2.NormalColor.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources>
Now it looks like it does in Windows 8. Note that you can also use Aero
instead of Aero2
if you want the Windows 7 look (also change the referenced dll of course!), but I think Aero2
looks much more "native" on Win10.现在它看起来像在Windows 8中。注意,如果你想要Windows 7外观(也改变引用的dll当然!),你也可以使用 Aero
而不是Aero2
,但我认为Aero2
在Win10上看起来更“本机” 。
EDIT: After further testing, turns out this is not 100% perfect, although it's close enough. 编辑:经过进一步的测试,结果证明这不是100%完美,虽然它足够接近。 For example: disabled text boxes are not grayed out, and ListView
s seems to not be affected at all, they still look like they crawled out of Windows 98's ass... if anyone has a clue on how to make the Aero2 style stick to them as well it would be great例如:禁用的文本框不会显示为灰色,而 ListView
似乎根本没有受到影响,它们看起来仍然像是从Windows 98的屁股中爬出来...如果有人知道如何让Aero2风格坚持下去它们也很棒
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.