Set Color of
Windows App Title Bar
In Windows UWP Apps kann man die Farbe des Anwendungs
Fensters durch die ApplicationView anpassen.
Hier der C# Windows UWP Code für eine DarkMode Anwendung
public MainPage()
{
this.InitializeComponent();
//---< set App Title Bar
>---
// Get the instance of the
Title Bar
var appTitelBar = ApplicationView.GetForCurrentView().TitleBar;
// Set the color of the Title
Bar content
appTitelBar.BackgroundColor =
Colors.Black;
appTitelBar.ForegroundColor =
Colors.White;
// Set the color of the Title
Bar buttons
appTitelBar.ButtonBackgroundColor
= Colors.Black;
appTitelBar.ButtonForegroundColor
= Colors.White;
////< hide App Bar >
var coreTitleBar =
CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = false;
////</ hide App Bar >
//---</
set App Title Bar >---
}
|