[英]Title Bar with Fluent Design System - UWP App
我正在用Fluent Design System开发一个新的UWP应用,我希望背景使用丙烯酸材料,并且我正在使用<Grid Background="{ThemeResource SystemControlBaseHighAcrylicWindowBrush}">
我也希望UWP应用的标题栏透明(与Fluent Design System一起使用),我正在使用它:
var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = true;
但是最小化,最大化和闭合对接不会变得透明,为什么?
我希望应用程序的标题栏与Windows 10计算器相同!
您可以使用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;
文档参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.