This is a fork of this repository:
https://github.com/GiGong/WPF_CustomWindow_TitleBar
I've only made a few alterations so full credit should go to GiGong.
WPF does not provide customizable title bars. However, it does provide a 'windowless' option allowing you to add your own title bar. Common reasons for doing this are adding additional buttons, tabs or changing the colour.
Getting the look of your custom bar to match Windows defaults isn't as easy as it sounds.
This .NET Framework WPF app shows you how to do this. You can copy the MainWindow code into your own WPF app or build your app using this as a template.
This doesn't cover all possible Windows 10 colour schemes, just one. However the colours can be easily changed.
I've adjusted the positioning and colours to mimic the Windows 10 dark theme title bars as closely as possible.