简体   繁体   English

Windows Phone 8编辑标题枢纽页面

[英]Windows Phone 8 edit header pivot page

I'm create WP application and want create next design pivot page: Pictures 我正在创建WP应用程序,并希望创建下一个设计枢纽页面: 图片

I'm find xaml style code, but it's not something that I need. 我找到了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>

Tell me how to do this style? 告诉我该怎么做?

ChubosaurusSoftware I want to change the style of the active item pivot page. ChubosaurusSoftware我想更改活动项目数据透视页的样式。

If that is the case, I already answered this. 如果是这样,我已经回答了。 You got the only the partial Templates that are need. 您只有所需的部分Templates

See How To Style A Pivot Item Header . 请参见如何设置数据透视表头的样式 It is a full solution to change the background/foreground of the Selected Pivot Header. 这是更改“选定的数据透视表头”的背景/前景的完整解决方案。 Noticed the Storyboards 注意到Storyboards

You will need the primitive controls namespace if you're modifying the Header Template 如果要修改标题模板,则需要原始控件名称空间

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

Useful SO Links 有用的SO链接

How to Style the Selected PivotItem Header 如何设置选定的PivotItem标头的样式


If you need more help, then what are you trying to Style your Pivot Header to? 如果您需要更多帮助,那么您打算将Pivot Header设置为哪种样式? That image with the bottom border for the SelectedItem? 该图像具有SelectedItem的底部边框?

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

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