Search code examples
c#windowscolorsuwptitlebar

UWP - Change back button color without changing minimize/close button colors


I am trying to change the background colors of the Title Bar buttons in my app (the Back button and the minimize/expand/close buttons). Specifically, I want the back button color to be difference from the minimize/expand/close buttons. This code changes both the back button and minimize/expand/close buttons color; How can I change the colors separately from eachother?

var titleBar = ApplicationView.GetForCurrentView().TitleBar;

if (titleBar != null)
{
    // I only want to change the back button color here, but this code
    // changes both the back button and resize/close buttons color too
    titleBar.ButtonBackgroundColor = Windows.UI.Colors.DarkBlue;
}

Solution

  • That's not possible unfortunately. You can however extend your app's content to the title bar and then create your own back button.Take a look here.