2013-10-29 66 views
0

我正在製作一個Windows Phone 8 C#/ XAML應用程序其中我要使用樞軸刪除樞軸標題和標題

我需要別的東西,讓我在樞軸之間進行切換,以取代樞軸頭 - 是這樣的:

____________________________ 
|       | 
|   O O   | 
|       | 
| ...pivot content... | 
|  ........   | 

(這兩個「O」符號單選按鈕或類似的東西,那改爲放送我希望所有人都可以看到整個頁面都可見)

現在,我認爲最好的解決方法是讓它看起來像這樣隱藏/刪除樞軸點pivotitems的標題,然後放置「單選按鈕」。

如何在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> 

我一直在尋找,但找不到任何會「敲響了警鐘」爲我這件事。

回答

3

您需要修改數據透視控件的頁眉模板。我在我的代碼是這樣做的:

<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> 
+0

沒有在我的通用應用程序中工作。雖然似乎是一個很好的解決方案/破解 –

+0

只需將可見性=「摺疊」屬性添加到標籤 - 它應該做的伎倆。此外,文本屬性成爲多餘的方式(因爲我們什麼都沒有顯示) –