C# 拆下枢轴&x27;s头&;标题

C# 拆下枢轴&x27;s头&;标题,c#,xaml,windows-phone-8,C#,Xaml,Windows Phone 8,我正在制作一个Windows Phone 8 C#/XAML应用程序,其中我将使用Pivots 我需要用其他可以在数据透视之间切换的东西来替换数据透视标题-类似这样的东西: ____________________________ | | | O O | | | | ...pivot content... | | ....

我正在制作一个Windows Phone 8 C#/XAML应用程序,其中我将使用Pivots

我需要用其他可以在数据透视之间切换的东西来替换数据透视标题-类似这样的东西:

 ____________________________
 |                          |
 |           O O            |
 |                          |
 |    ...pivot content...   |
 |       ........           |
 <phone:Pivot Title="">
      <phone:Pivot.HeaderTemplate>
       <DataTemplate>
         <Grid Margin="0 -12 0 0"  Height="auto">
          <TextBlock Padding="0" Height="auto" Margin="0" Text="{Binding}"/>
         </Grid>
       </DataTemplate>
      </phone:Pivot.HeaderTemplate>
        <phone:Pivot.ItemTemplate>
         <DataTemplate>
          <Grid Margin="0"/>
         </DataTemplate>
      </phone:Pivot.ItemTemplate>
      <phone:PivotItem Header="" Height="100" Margin="162,0,218,116">
        <Grid/>
      </phone:PivotItem>
    </phone:Pivot>
(这两个“O”符号是单选按钮或类似的东西,用于代替轴心标题,我希望它们在整个页面查看期间都保持可见)

现在,我认为最好的解决方法是隐藏/删除透视和透视项目的标题,并放置“单选按钮”。

如何在windows phone 8上实现它(最好是通过在XAML中设置样式,我需要多个类似于此的pivotcontrol-在多个页面上)?

 //this is pseudocode based on XAML just to show the structure I'm thinking about
 <grid>
   <radiobuttongroup>
       <radiobutton />  //"radiobuttons" for moving between pivot items
       <radiobutton />
       ...
   </radiobuttongroup>
   <pivot>
     <pivotitem />   //the actual pivot items with content
     <pivotitem />
     ....
   </pivot>
 </grid>
//这是基于XAML的伪代码,只是为了显示我正在考虑的结构
//用于在轴项目之间移动的“单选按钮”
...
//包含内容的实际透视项
....

我一直在搜索,但找不到任何能让我“警觉”的东西。

也许可以看看我的示例,看看如何在windows phone上模拟当前的twitter应用程序

它与您要查找的内容并不完全相同,但它包含了xaml代码,说明了如何设置没有标题的数据透视,以及如何通过另一个UI项处理数据透视的更改


我希望这能有所帮助……

请看一下我的示例,了解如何在windows phone上模拟当前的twitter应用程序

它与您要查找的内容并不完全相同,但它包含了xaml代码,说明了如何设置没有标题的数据透视,以及如何通过另一个UI项处理数据透视的更改


我希望这有助于…

您需要修改pivot控件的标题模板。我在代码中这样做:

 ____________________________
 |                          |
 |           O O            |
 |                          |
 |    ...pivot content...   |
 |       ........           |
 <phone:Pivot Title="">
      <phone:Pivot.HeaderTemplate>
       <DataTemplate>
         <Grid Margin="0 -12 0 0"  Height="auto">
          <TextBlock Padding="0" Height="auto" Margin="0" Text="{Binding}"/>
         </Grid>
       </DataTemplate>
      </phone:Pivot.HeaderTemplate>
        <phone:Pivot.ItemTemplate>
         <DataTemplate>
          <Grid Margin="0"/>
         </DataTemplate>
      </phone:Pivot.ItemTemplate>
      <phone:PivotItem Header="" Height="100" Margin="162,0,218,116">
        <Grid/>
      </phone:PivotItem>
    </phone:Pivot>

您需要修改枢轴控件的标题模板。我在代码中这样做:

 ____________________________
 |                          |
 |           O O            |
 |                          |
 |    ...pivot content...   |
 |       ........           |
 <phone:Pivot Title="">
      <phone:Pivot.HeaderTemplate>
       <DataTemplate>
         <Grid Margin="0 -12 0 0"  Height="auto">
          <TextBlock Padding="0" Height="auto" Margin="0" Text="{Binding}"/>
         </Grid>
       </DataTemplate>
      </phone:Pivot.HeaderTemplate>
        <phone:Pivot.ItemTemplate>
         <DataTemplate>
          <Grid Margin="0"/>
         </DataTemplate>
      </phone:Pivot.ItemTemplate>
      <phone:PivotItem Header="" Height="100" Margin="162,0,218,116">
        <Grid/>
      </phone:PivotItem>
    </phone:Pivot>


这正是我想要的。:)这正是我要找的。:)在我的通用应用程序中不起作用。虽然看起来是一个很好的解决方案/hack,但只需在标记中添加Visibility=“Collapsed”属性,就可以了。此外,文本属性变得多余,这样(因为我们没有显示任何内容)在我的通用应用程序中不起作用。虽然看起来是一个很好的解决方案/hack,但只需在标记中添加Visibility=“Collapsed”属性,就可以了。同样,文本属性也会以这种方式变得多余(因为我们没有显示任何内容)