0
PivotItem SelectedPivot;
        SelectedPivot = (PivotItem)AIP_Pivot.SelectedItem;
        SelectedPivot.FontSize = 35;

我已经实现了这段代码,但它不起作用。谁能告诉我为什么?解决方案是什么?

4

1 回答 1

1

尝试使用 Microsoft 提供的默认 Pivot 样式和模板,并在此处为所选项目编辑前景,如下所示:

<VisualState x:Name="Selected">
              <Storyboard>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                               Storyboard.TargetProperty="Foreground" >
                  <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
                                               Storyboard.TargetProperty="Background" >
                  <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                </ObjectAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>

您可以在此处查找枢轴项目的完整样式。

于 2017-10-05T11:20:12.043 回答