您可以使用ApplicationViewTitleBar
类的属性来做到这一点:
var view = ApplicationView.GetForCurrentView();
// active
view.TitleBar.BackgroundColor = Color.FromArgb(255, 8, 87, 180);
view.TitleBar.ForegroundColor = Colors.White;
// inactive
view.TitleBar.InactiveBackgroundColor = Color.FromArgb(255, 8, 87, 180);
view.TitleBar.InactiveForegroundColor = Colors.Black;
// button
view.TitleBar.ButtonBackgroundColor = Color.FromArgb(255, 8, 87, 180);
view.TitleBar.ButtonForegroundColor = Colors.White;
view.TitleBar.ButtonHoverBackgroundColor = Colors.Blue;
view.TitleBar.ButtonHoverForegroundColor = Colors.White;
view.TitleBar.ButtonPressedBackgroundColor = Colors.Blue;
view.TitleBar.ButtonPressedForegroundColor = Colors.White;
view.TitleBar.ButtonInactiveBackgroundColor = Colors.DarkGray;
view.TitleBar.ButtonInactiveForegroundColor = Colors.Gray;
文档参考:
- ApplicationViewTitleBar 类
- 标题栏自定义