wp7 pivotcontrol 设置标题为空 [英] wp7 pivotcontrol set header null

查看:22
本文介绍了wp7 pivotcontrol 设置标题为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 PivotControl,我使用这样的代码将 Title 和 Header 属性设置为 null,但 PivotControl 仍然在 Header 中显示一个字符串,其中包含绑定到该 PivotItem 的对象的名称.我想基本上隐藏 PivotItem 的 Header 中的所有内容.我该怎么做?

For a PivotControl, I am using code like this to set the Title and Header Property to null, but the pivotcontrol still displays a string in the Header with the name of the object that is being bound for that PivotItem. I want to basically hide everything in the Header of the PivotItem. How should I do this?

<controls:Pivot 
    x:Name="PivotControl"
    TitleTemplate="{x:Null}"
    HeaderTemplate="{x:Null}"
    ItemsSource="{Binding TestEntries}" 
    ItemTemplate="{StaticResource TestEntryItemTemplate}"
    SelectionChanged="PivotControl_SelectionChanged" LoadedPivotItem="PivotControl_LoadedPivotItem">
</controls:Pivot>

推荐答案

做了这样的事情:

    <DataTemplate x:Key="TestEntryHeaderTemplate">
        <TextBlock Text="" Height="1"></TextBlock>
    </DataTemplate>

和 PivotControl

and for PivotControl

    <controls:Pivot 
        x:Name="PivotControl"
        Title="{StaticResource AppName}"
        HeaderTemplate="{StaticResource TestEntryHeaderTemplate}" 
        ItemsSource="{Binding TestEntries}" 
        ItemTemplate="{StaticResource TestItemTemplate}"
        SelectionChanged="PivotControl_SelectionChanged" LoadedPivotItem="PivotControl_LoadedPivotItem">
    </controls:Pivot>

这篇关于wp7 pivotcontrol 设置标题为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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