Am developing a simple app for learning pivot control
in wp7.
can we add images for pivot item instead of text in header(red mark area in bellow image ).
is it possible to add images, please suggest me
my xaml code is:
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivot Control-->
<controls:Pivot Title="MY APPLICATION" Name="mainPivot">
<!--Pivot item one-->
<controls:PivotItem Header="item1">
<Grid>
<Image Source="/SchoolList;component/Gallery/child.jpg"/>
</Grid>
</controls:PivotItem>
<!--Pivot item two-->
<controls:PivotItem Header="item2">
<Grid>
<Image Source="/SchoolList;component/Gallery/class.jpg"/>
</Grid>
</controls:PivotItem>
</controls:Pivot>
</Grid>
thanks in advance
with the Idea of @toni petrina i added images to the
HeaderTemplate
to the pivot control usingdata binding
. am implemented image gallery in my app using pivot with images in header template gives great look and feelXaml code is :
and i have created a simple
class
with onestring property
to save theimages source
and prepared aList
and assigned to the pivotItemsSource
on page loaded eventuse this tip :
and then set your Pivot Item header as
Yes it is. Simply use HeaderTemplate
May I also add that while this is generally possible, it is not recommended for the general use. Unless you need pivot functionality for something completely different. It is somewhat non intuitive.