我有一個NavigationView并且想更改標題背景顏色:

我努力了:
- 尋找
generic.xaml可能的樣式來覆寫 - 使用 HeaderTemplate
這是我的代碼:
<NavigationView Background="Gray">
<NavigationView.Header>
<Border Background="Green">
<TextBlock Text="Header"/>
</Border>
</NavigationView.Header>
<Border Background="Orange">
<TextBlock Text="Sweet content"/>
</Border>
</NavigationView>
uj5u.com熱心網友回復:
嘗試覆寫NavigationViewContentBackground主題資源:
<NavigationView Background="Gray">
<NavigationView.Resources>
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Red" />
</NavigationView.Resources>
<NavigationView.Header>
<Border Background="Green">
<TextBlock Text="Header"/>
</Border>
</NavigationView.Header>
<Border Background="Orange">
<TextBlock Text="Sweet content"/>
</Border>
</NavigationView>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/435603.html
