Reputation: 1217
I'm making a Windows Phone 8 C#/XAML App in which I'm going to use Pivots.
I need to replace Pivot headers with something else that would allow me to switch between the pivots - something like this:
____________________________
| |
| O O |
| |
| ...pivot content... |
| ........ |
(The two "O" symbols are radiobuttons or something similar, that serve instead of pivot headers, I'd like for all of them to stay visible for the whole time the page is viewed)
Now, I think the best way to work around it and make it look like this is to hide/remove the headers of pivot & pivotitems and place the "radiobuttons" instead.
How to achieve it on windows phone 8 (preferably by styling in XAML, I need more than one pivotcontrol that will look like this - on multiple pages)?
//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>
I've been searching but can't find anything that would "ring a bell" for me about it.
Upvotes: 0
Views: 2509
Reputation: 138
You need to modify header template for the pivot control. I did it in my code like this:
<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>
Upvotes: 3
Reputation: 6142
Maybe take a look at my example on how to mimic the current twitter app on windows phone here http://depblog.weblogs.us/2013/08/29/twitterate-your-windows-phone-app/
It is not exactly the same as what you are looking for, but it contains the xaml code on how to set up a pivot without headers and handle the changing of the pivots through another UI item.
I hope this helps...
Upvotes: 1