wp8 pivot控制如何改变未选择的枢轴的样式

时间:2013-10-19 05:37:56

标签: xaml windows-phone-8 pivot

我有一个枢轴控制,我想改变未选择的枢轴的风格。特别是,我想改变不透明度。

我知道它与Primitives:PivotHeadersControl有关,但我无法弄清楚该控件的样式设置了什么。

我的支点

有以下风格

                                                                                               

                </Grid>
            </ItemsPanelTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate>
                <Grid Background="{StaticResource TabHeaderBackgroundBrush}"  >
                    <Border BorderBrush="White" BorderThickness="1">
                    <TextBlock Text="{Binding}" FontSize="28"  Margin="15,0,15,0" 
                               Foreground="{StaticResource ForegroundBrush}"/>
                    </Border>
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Controls:Pivot">
                <Grid   HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalAlignment}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Grid Background="Transparent" CacheMode="BitmapCache" Grid.RowSpan="2"  />
                    <Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache"
                          Grid.Row="2"  />
                    <ContentPresenter ContentTemplate="{TemplateBinding TitleTemplate}" 
                                      Content="{TemplateBinding Title}" Margin="24,17,0,-7"/>
                    <Primitives:PivotHeadersControl x:Name="HeadersListElement" 
                                      Grid.Row="1" >

                    </Primitives:PivotHeadersControl>

                    <Border Margin="0,-1,0,0" BorderBrush="White" 
                            BorderThickness="1" Grid.Row="2"
                            Background="{StaticResource TabBackgroundBrush}">
                    <ItemsPresenter x:Name="PivotItemPresenter" 
                                    Margin="0"/>
                    </Border>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

0 个答案:

没有答案