I am looking to change the colors of the title bar to better suit my app similar to what has been done in the Mail app. How would I go about doing that?
The background and foreground colors of parts of the TitleBar can be changed as follows.
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.BackgroundColor = Colors.Black;
titleBar.ForegroundColor = Colors.White;
titleBar.ButtonBackgroundColor = Colors.Black;
titleBar.ButtonForegroundColor = Colors.White;
Be aware that these changes happen after the app has displayed so the user will see the colors change.
You can customize the background of the title bar by doing the following:
var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
var titleBar = appView.TitleBar;
titleBar.BackgroundColor = Colors.Black;
You can change the other colors of the title bar like the foreground color or the button colors by changing the color in the other properties.
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