0

I am working on an WPF application. WPF allows me to style everything but I just want my app to have the same theme as the other Windows applications. I want it to use the current Windows theme. Is this possible?

g.arbia777
  • 141
  • 1
  • 1
  • 7
  • Does this answer your question? [How to make a WPF program match the currently selected Windows Theme](https://stackoverflow.com/questions/8859215/how-to-make-a-wpf-program-match-the-currently-selected-windows-theme) – Victor Oct 11 '20 at 21:54
  • The useful parts of that SO thread all 404. – Andy Oct 12 '20 at 08:54

1 Answers1

0

Whilst you're doing your styling you will be using brushes and colors.

If you want your styling to conform to the windows theme then you should ensure all your brushes and colors used are based on SystemColors.

https://docs.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/how-to-paint-an-area-with-a-system-brush?view=netframeworkdesktop-4.8

https://docs.microsoft.com/en-us/dotnet/api/system.windows.systemcolors?view=netcore-3.1

You will find that a number of the default templates do not do this and instead have "hard coded" colors. Hence you will have to provide your own replacement templates for all these.

Unless you have extensive experience of wpf templating you are likely under estimating the amount of work which will be involved.

This is a lot of work.

If you look at custom themes which are available you'll often find the author missed some subtle aspects of controls here and there.

Andy
  • 9,254
  • 2
  • 14
  • 17