在 Windows phone 7 应用程序上创建 Pivot 页脚 [英] Creating Pivot Footers on Windows phone 7 application

查看:34
本文介绍了在 Windows phone 7 应用程序上创建 Pivot 页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道windows phone的pivot control有pivot headers和pivot item control两部分.

I know that pivot control of windows phone has two parts pivot headers and pivot item control.

我想显示的是,枢轴项控件(或枢轴页脚)下方的枢轴标题.

what i want to display is, pivot headers below the pivot item control (or pivot footers).

但我发现这个东西在枢轴控制中不可用.

But i found this this thing is not available in pivot control.

有没有其他方法可以在 wp7 应用的页脚显示标签.

Is there any other way, to display tabs at the footer of wp7 app.

感谢和问候

推荐答案

您可以为 Pivot 控件创建自己的样式.将标题向下移动的最简单方法是创建默认 Pivot 样式的副本并对其稍作修改.

You can create your own style for Pivot control. The easiest way to move header down is create a copy of default Pivot style and slightly modify it.

    <Style x:Key="PivotStyle" TargetType="controls: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="controls:Pivot">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache" Grid.RowSpan="3"/>
                        <ContentPresenter ContentTemplate="{TemplateBinding TitleTemplate}" Content="{TemplateBinding Title}" Margin="24,17,0,-7"/>
                        <ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="1"/>
                        <controlsPrimitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

这篇关于在 Windows phone 7 应用程序上创建 Pivot 页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆