'WinUI: How to change NavigationView.Header background color?

I have a NavigationView and would like to change the header background color:

header background with arrow

I have tried:

  • Looking in generic.xaml for likely styles to override
  • Using a HeaderTemplate

Here's my code:

<NavigationView Background="Gray">
    <NavigationView.Header>
        <Border Background="Green">
            <TextBlock Text="Header"/>
        </Border>
    </NavigationView.Header>
    <Border Background="Orange">
        <TextBlock Text="Sweet content"/>
    </Border>
</NavigationView>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source