WPF程序通常情况下没办法修改窗体标题栏的样式,包括标题栏的背景颜色。
不过借助一个叫Fluent.Ribbon的第三方控件,貌似可以修改标题栏的背景颜色。
可以通过NuGet来安装这个控件:Install-Package Fluent.Ribbon
修改App.xaml代码:
<Application x:Class="WpfDemo.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local=