📜  亚克力 UWP 标题栏 C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.911000             🧑  作者: Mango

代码示例1
var view = ApplicationView.GetForCurrentView();

            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
            coreTitleBar.ExtendViewIntoTitleBar = true;

            // 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;