in a Windows 10 UWP we can style the title bar and window buttons (windows chrome). However this does not work on the close button when use hover or click onto them. Take the following snippet:
Color PrimaryColor = Color.FromArgb( 0xFF, 0xFF, 0x00, 0x00 );
Color ContrastColor = Color.FromArgb( 0xFF, 0x00, 0x00, 0x00 );
Color SemiColor = Color.FromArgb( 0xFF, 0x7F, 0x00, 0x00 );
ApplicationView AppView = ApplicationView.GetForCurrentView();
AppView.TitleBar.ButtonInactiveBackgroundColor = ContrastColor;
AppView.TitleBar.ButtonInactiveForegroundColor = PrimaryColor;
AppView.TitleBar.ButtonBackgroundColor = ContrastColor;
AppView.TitleBar.ButtonForegroundColor = PrimaryColor;
AppView.TitleBar.ButtonHoverBackgroundColor = PrimaryColor;
AppView.TitleBar.ButtonHoverForegroundColor = ContrastColor;
AppView.TitleBar.ButtonPressedBackgroundColor = SemiColor;
AppView.TitleBar.ButtonPressedForegroundColor = ContrastColor;
This should make all buttons black with a red foreground (the icon). When pressed a half red background should be used.
It works flawlessly for the min and max buttons - on the close button only the background and foreground (and the inactive version of it) display correctly. The hover and pressed states fall back to the default windows values.
Refer to the following image. The close button has another red (the default one) and the default white foreground when hovered over.
_
Does anyone have any idea what the problem is? Is it a bug or am I doing something wrong?
Thanks in advance!
-Simon
You're doing it right, this is just the way it is right now. Keep in mind that they are still changing title bar styling based on user feedback, so it's possible this could change. If you want more control over certain aspects of the title bar, consider building a fully customized title bar using the CoreApplicationViewTitleBar.ExtendViewIntoTitleBar property. Not sure if it will solve this specific problem, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With