C# - UWP: Color of Titlebar

By , 5/24/2015
(0 ratings)
The new Universal Windows Platform Apps give us the opportunity to change the colors of the title bar of the app. This snippet shows an example for a green layout like the one of Excel.

Neccessary Namespace
var view = ApplicationView.GetForCurrentView();

view.TitleBar.BackgroundColor = Colors.DarkGreen;
view.TitleBar.ForegroundColor = Colors.White;

view.TitleBar.ButtonBackgroundColor = Colors.DarkGreen;
view.TitleBar.ButtonForegroundColor = Colors.White;

view.TitleBar.ButtonHoverBackgroundColor = Colors.Green;
view.TitleBar.ButtonHoverForegroundColor = Colors.White;

view.TitleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 0, 120, 0);
view.TitleBar.ButtonPressedForegroundColor = Colors.White;

view.TitleBar.ButtonInactiveBackgroundColor = Colors.DarkGray;
view.TitleBar.ButtonInactiveForegroundColor = Colors.Gray;

view.TitleBar.InactiveBackgroundColor = Colors.DarkGreen;
view.TitleBar.InactiveForegroundColor = Colors.Gray;
Tagged with UWP, Apps, Fenster, Rahmen, Color, Farbe.



Log in, to comment!