简体   繁体   English

有没有办法让Windows 10中的WPF应用程序不那么“丑陋”?

[英]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可用性/清晰度的客观降级的一些示例:

  • Everything looks like Windows 95, all gray without shading of any kind, almost like there's a custom theme (or a default theme is missing or something) 一切看起来像Windows 95,所有灰色都没有任何阴影,几乎就像有自定义主题(或缺少默认主题或其他东西)
  • A lot of disabled elements do not get "grayed out" (see image below) 很多残疾人的元素都没有“变灰”(见下图)
  • Disabled 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前的“蓝色部分”外观
  • etc. 等等

例

  1. Is this "normal", ie: is this the new default WPF theme? 这是“正常”,即:这是新的默认WPF主题吗?
  2. If so, can I change it? 如果是这样,我可以更改吗? It's really bad 这真的很糟糕
  3. If not, what am I missing? 如果没有,我错过了什么?

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM