繁体   English   中英

Windows Phone 8编辑标题枢纽页面

[英]Windows Phone 8 edit header pivot page

我正在创建WP应用程序,并希望创建下一个设计枢纽页面: 图片

我找到了xaml样式代码,但这不是我所需要的。

    <Style x:Key="MainPivotStyle" 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 Grid.RowSpan="2"
                          Background="DodgerBlue"
                          CacheMode="BitmapCache" />
                    <ContentPresenter Grid.Row="0"
                                      Margin="24,17,0,-7"
                                      Content="{TemplateBinding Title}"
                                      ContentTemplate="{TemplateBinding TitleTemplate}" />
                    <primitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1" />
                    <Grid Grid.Row="2"
                          Background="{TemplateBinding Background}"
                          CacheMode="BitmapCache" />
                    <ItemsPresenter x:Name="PivotItemPresenter"
                                    Grid.Row="2"
                                    Margin="{TemplateBinding Padding}" />
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

告诉我该怎么做?

ChubosaurusSoftware我想更改活动项目数据透视页的样式。

如果是这样,我已经回答了。 您只有所需的部分Templates

请参见如何设置数据透视表头的样式 这是更改“选定的数据透视表头”的背景/前景的完整解决方案。 注意到Storyboards

如果要修改标题模板,则需要原始控件名称空间

<phone:PhoneApplicationPage
    xmlns:Primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone" x:Name="phoneApplicationPage">

有用的SO链接

如何设置选定的PivotItem标头的样式


如果您需要更多帮助,那么您打算将Pivot Header设置为哪种样式? 该图像具有SelectedItem的底部边框?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM