i am using pivot control, and i want to change the forground color of headers!
but somehow i am not able to do it with pretty easy guess !
<Pivot x:Name="pivot1">
<PivotItem x:Name="pivot1item1" Header="Profile" Style="{StaticResource PuzzlePivotItemHeader}">
<Controls:Profile />
</PivotItem>
<PivotItem x:Name="pivot1item2" Header="Filters" Style="{StaticResource PuzzlePivotItemHeader}">
<Controls:Filters />
</PivotItem>
</Pivot>
and style is :
<Style x:Key="PuzzlePivotItemHeader" TargetType="PivotItem">
<Setter Property="Foreground" Value="White"/>
</Style>
i just want the header fontsize change and color as white !!
how could it possible?
If you just want to change the background color of all the headers, this is how you can do it in Window Phone 8.1.
First, use Expression Blend to generate the default style of the Pivot control.
Find this line below, the only change I have made to the default style is adding
Background="{TemplateBinding BorderBrush}"
to the PivotHeaderPanel which is the panel that hosts all the headers.The reason that I use
TemplateBinding
here is because doing this gives me the flexibility to change the headers background by specifying the BorderBush of the Pivot. As the BorderBrush is not used anywhere in the control, there won't be any side effect if we change it.So, all you need to do in your Pivot is this.