So, I'm trying to customize my wpf app a bit, but thought I would be better to leave the title bar as it is and not do a custom title bar. Problem is, the title bar is in light mode altough Windows is set to dark mode. Unfortunately I did not find a proper "guide" which shows how I can support light and dark mode title bars.
Most of the stackoverflow answers said that you should customize the title bar in the styles with custom buttons and everything else, but I'm not sure if this is the best approach.
Does anyone know how to switch the wpf title bar to dark mode (and of course switch it back to light mode)?
I am using WPF with .NET 5 and C# :)
I set windows to dark mode (Hell = Light, Dunkel = Dark)
EDIT 1:
I tried the answer in this post How do I get a black Title Bar for dark Mode in WPF Unfortunately I did not work like expected. First of all if I insert the style setter property for the WindowChrome I get an error that the property "WindowChrome" does not exists in the "System.Windows.Shell" namespace.
In the Setter.Value I got the same error. Maybe it is slightly different in .NET 5?
I added this code (I also tried shell:WindowChrome.WindowChrome as the docs said):
<Setter Property="shell:WindowChrome">
<Setter.Value>
<shell:WindowChrome />
</Setter.Value>
</Setter>
And those are the namespaces I tried:
xmlns:shell="System.Windows.Shell"
xmlns:shell1="http://schemas.microsoft.com/expression/blend/2008"
xmlns:shell2="http://schemas.microsoft.com/netfx/2009/xaml/presentation"