你可以做到这一点与后面的代码:
XAML:
<Pivot x:Uid="AppTitle" x:Name="MyPivot" Title="" Foreground="White">
<PivotItem>
<PivotItem.Header>
<TextBlock x:Uid="HeaderTextFromResources" Foreground="White" Text="" />
</PivotItem.Header>
...
C#:
private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
foreach (PivotItem pivotItem in MyPivot.Items)
{
if (pivotItem == MyPivot.Items[MyPivot.SelectedIndex])
{
// Header of the selected item to white
((TextBlock)pivotItem.Header).Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 255, 255));
}
else
{
// Headers of other items to slightly darker
((TextBlock)pivotItem.Header).Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 230, 230, 230));
}
}
}
相关? http://stackoverflow.com/questions/4245046/change-background-of-title-and-header-in-pivot-control –