Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't WPF show Windows 8 style buttons in Windows 8

This is a Windows 8 style button:

And this is a button in .NET 4.5 WPF app:

Any ideas why WPF doesn't show the native Windows 8 style buttons? Is there a way to fix this?

like image 386
Elmo Avatar asked Jan 07 '13 19:01

Elmo


2 Answers

What you can do is use a custom WPF styling from HERE.

Below is a screenshot of the styles as applied to the same WPF application in multiple states. The top is obviously Aero themed, and the bottom set is with the newly applied styles.

And here is a link to the XAML.

like image 95
CC Inc Avatar answered Nov 19 '22 16:11

CC Inc


WPF does not use any native Windows controls - it comes with its own controls and styles for different Windows versions. On Windows 7 you can find the following assemblies

PresentationFramework.Aero.dll
PresentationFramework.Classic.dll
PresentationFramework.Luna.dll
PresentationFramework.Royale.dll

and I guess there is a new one for Windows 8. Because WPF is not build upon native controls it is possible to have a XP-style WPF application on Windows 7 and a Windows-7-style application on Windows XP.

If you want to match the native Windows 8 UI better than what WPF offers out of the box, you will have to create your own styles - probably based on the styles provided by WPF.

like image 2
Daniel Brückner Avatar answered Nov 19 '22 17:11

Daniel Brückner