windows-phone-8 – Windows Phone 8:删除数据透视表头

我的枢轴控制的造型有一个奇怪的问题.
我在Expression Blend中编辑了默认模板的副本,因为我想删除整个标题.

适应的风格:

<Style x:Key="PivotWithoutHeader" 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 Background="{TemplateBinding Background}" Grid.RowSpan="3"/>
                        <!--<ContentControl ContentTemplate="{TemplateBinding TitleTemplate}" Content="{TemplateBinding Title}" HorizontalAlignment="Left" Margin="24,17,-7" Style="{StaticResource PivotTitleStyle}"/>-->
                        <Primitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1"/>
                        <ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

而我的风格用法:

<phone:Pivot Grid.Row="1" x:Name="Objects" ItemsSource="{Binding Profiles}" 
                                 Style="{StaticResource PivotWithoutHeader}">
                        <phone:Pivot.ItemContainerStyle>
                            <Style TargetType="phone:PivotItem">
                                <Setter Property="HorizontalAlignment" Value="Stretch" />
                            </Style>
                        </phone:Pivot.ItemContainerStyle>
                        <phone:Pivot.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Image Source="Resources/homer.png"/>
                                    <TextBlock Text="{Binding Name}"/>
                                    <TextBlock Text="#Sample" />
                                    <Button Margin="347,0" Command="{Binding DataContext.SettingsCommand,ElementName=Objects}" CommandParameter="{Binding .}" />
                                </Grid>
                            </DataTemplate>
                        </phone:Pivot.ItemTemplate>
                    </phone:Pivot>

我的想法只是删除或设置< Primitives:PivotHeadersControl>的可见性.折叠但我的应用程序崩溃没有任何异常和我的输出窗口中的以下消息:“程序'[2332] TaskHost.exe已退出代码-1073741819(0xc0000005)’访问违规’”出现.

我读了一些帖子来向上移动枢轴,以便标题不在屏幕上,但我需要在我页面底部的自定义枢轴,上面有一些其他控件.

有没有人知道如何删除标题?

编辑:为清楚起见,我想删除标题和标题.

您可以通过使用空白DataTemplate替换Pivot.HeaderTemplate属性来删除数据透视表上的PivotItem标头.如果您尝试删除标题而不是标题,那么我也想知道解决方案. ^^
<phone:Pivot ItemsSource="{Binding Data}" ItemTemplate="{StaticResource CustomPivotItemTemplate}">
    <phone:Pivot.HeaderTemplate>
        <DataTemplate/>
    </phone:Pivot.HeaderTemplate>
</phone:Pivot>

相关文章

文章浏览阅读2.2k次,点赞6次,收藏20次。在我们平时办公工作...
文章浏览阅读1k次。解决 Windows make command not found 和...
文章浏览阅读3.2k次,点赞2次,收藏6次。2、鼠标依次点击“计...
文章浏览阅读1.3w次。蓝光版属于高清版的一种。BD英文全名是...
文章浏览阅读974次,点赞7次,收藏8次。提供了更强大的功能,...
文章浏览阅读1.4w次,点赞5次,收藏22次。如果使用iterator的...