修改数据透视表项字体大小和字体系列

Aja*_*y P 2 pivot windows-phone-7 windows-phone-7.1 pivotitem windows-phone-8

我正在开发一个Windows手机应用程序.我添加了样式Pivot Item.

<phone:PhoneApplicationPage.Resources>
    <Style TargetType="phone:Pivot">
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Grid/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="phone:Pivot">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
  VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid Background="#D62429" CacheMode="BitmapCache" Grid.RowSpan="2" />
                        <Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache"
    Grid.Row="2" />
                        <ContentPresenter ContentTemplate="{TemplateBinding TitleTemplate}"
                Content="{TemplateBinding Title}" Margin="25,10,0,0" />
                        <Primitives:PivotHeadersControl x:Name="HeadersListElement"
                                      Grid.Row="1" />
                        <ItemsPresenter x:Name="PivotItemPresenter"
              Margin="{TemplateBinding Padding}" Grid.Row="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>       
</phone:PhoneApplicationPage.Resources>
Run Code Online (Sandbox Code Playgroud)

它表现得像这样

在此输入图像描述

我正在尝试更改字体大小和字体系列,Pivot ItemPivot Title就是欢迎项目1.如何更改这些字体大小和字体系列?

小智 6

尝试以这种方式定义Pivot项:

 <Grid x:Name="LayoutRoot" Background="Transparent">
    <!--Pivot Control-->
    <controls:Pivot Title="WELCOME" FontSize="30" FontFamily="Arial">
        <!--Pivot item one-->
        <controls:PivotItem >
            <controls:PivotItem.Header>
                <TextBlock Text="item1" FontSize="30" FontFamily="Arial" Margin="0,30,0,0"/>
            </controls:PivotItem.Header>
            <Grid/>
        </controls:PivotItem>

        <!--Pivot item two-->
        <controls:PivotItem >
            <controls:PivotItem.Header>
                <TextBlock Text="item2" FontSize="30" FontFamily="Arial" Margin="0,30,0,0"/>
            </controls:PivotItem.Header>
            <Grid/>
        </controls:PivotItem>
    </controls:Pivot>
</Grid>
Run Code Online (Sandbox Code Playgroud)