简体   繁体   中英

Windows Phone 8 edit header pivot page

I'm create WP application and want create next design pivot page: Pictures

I'm find xaml style code, but it's not something that I need.

    <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.

If that is the case, I already answered this. You got the only the partial Templates that are need.

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

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

How to Style the Selected PivotItem Header


If you need more help, then what are you trying to Style your Pivot Header to? That image with the bottom border for the SelectedItem?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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