2

私は1つのWindows Phoneアプリを開発しています。にスタイルを追加しました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>

このように表示されます

ここに画像の説明を入力

のフォント サイズとフォント ファミリー、つまり Welcome と item 1 を変更しようPivot ItemPivot Titleます。これらのフォント サイズとフォント ファミリを変更するにはどうすればよいですか?

4

3 に答える 3

0

ピボット ヘッダーのフォント サイズまたはフォント ファミリを変更するには、ピボット内でこのコードを使用します。

<phone:Pivot.HeaderTemplate>                
            <DataTemplate>
                <Grid >
                    <TextBlock FontFamily="Times New Roman"  Text="{Binding}" FontSize="20" Height="auto"/>
                </Grid>                 
            </DataTemplate>
</phone:Pivot.HeaderTemplate>
于 2014-11-29T17:49:52.017 に答える