The following items describe the ways in which to surface a Pivot
on a page within Visual Studio:
Using the Windows Phone Pivot Application template, which can be selected when creating a new project. This template generates a Windows Phone application project, with the main page prepopulated with a Pivot
.
Using the Windows Phone Pivot Page template from the Visual Studio Add New Item dialog.
The Pivot
control can be added to the Toolbox in Visual Studio and can then be dropped onto the design surface of your page or onto the XAML editor.
The Pivot
control can be simply added to an existing page by removing the title panel of a page and adding the Pivot
XAML.
To use a Pivot
on an existing page, remove the title panel on the page and add a Pivot
element in XAML, like so:
<Grid x:Name="LayoutRoot" Background="Transparent">
<controls:Pivot Title="Windows Phone 8 Unleashed">
<controls:PivotItem Header="first">
<TextBlock Text="Lorem ipsum dolor sit amet, consectetur..."
TextWrapping="Wrap"
Style="{StaticResource PhoneTextSubtleStyle}"/>
</controls:PivotItem>
<controls:PivotItem Header="second">
<TextBlock Text="Lorem ipsum dolor sit amet, consectetur..."
TextWrapping="Wrap"
Style="{StaticResource PhoneTextSubtleStyle}"/>
</controls:PivotItem>
<controls:PivotItem Header="third">
<TextBlock Text="Lorem ipsum dolor sit amet, consectetur..."
TextWrapping="Wrap"
Style="{StaticResource PhoneTextSubtleStyle}"/>
</controls:PivotItem>
</controls:Pivot>
</Grid>
The Pivot
has Visual Studio design-time support. The Visual Studio designer automatically shifts to the active PivotItem
when the cursor is placed with the PivotItems
element in the XAML view.
When the app is launched, you see the result shown in Figure 11.2.
The usual page and application title panel should be omitted from any pages containing a Pivot
or Panorama
, because the Pivot
and the Panorama
take care of displaying that information.
3.136.161.103