简体   繁体   中英

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.

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:

  • 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)
  • A lot of disabled elements do not get "grayed out" (see image below)
  • Disabled button s do not get flattened (again, see image)
  • ListView items are not highlighted on mouseOver
  • ProgressBar s have the "blue segments" pre-XP look
  • etc.

例

  1. Is this "normal", ie: is this the new default WPF theme?
  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.

Just DON'T apply any tweaks for win10 you find on the internet to restore the coloring on windows borders. It messes up the WPF theme engine.

Sorry for wasting your time guys.

Well, I found out how to fix it (thanks to gix for pointing me in the right direction):

First step: reference the PresentationFramework.Aero2 assembly in your project
Second step: add the following to your 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.

EDIT: After further testing, turns out this is not 100% perfect, although it's close enough. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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