Freigeben über


Pivot control architecture for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

A pivot app comprises a base Pivot control that hosts individual pages of content. A PivotItem control is responsible for displaying the content within a page. You can use the designer or programmatically work with these elements. This topic will detail the architecture and anatomy of both the Pivot control and the PivotItem control.

This topic contains the following sections.

Pivot Control

The Pivot control is the base control for a pivot app and comprises two different layers. Each layer is contained within a Grid control that serves as the layout root for the Pivot control.

Layer

Type

Description

Headers List Element

PivotHeadersControl

The element responsible for displaying the headers for pivot items.

Pivot Item Presenter

ItemsPresenter

The ItemsPresenter control that displays a single PivotItem control from the set.

Headers List Element

Headers are displayed until they exceed the width of the control with the current header highlighted. If there are not enough headers available to take up the full width of the control, the headers do not loop and each header is displayed only once.

Pivot Item Presenter

This is a standard ItemsPresenter control responsible for being a placeholder for items content. It will contain the PivotItem control.

PivotItem Control

The PivotItem control displays the content within an individual viewing page. PivotItem controls are defined in XAML as a standard ItemsControl element. The PivotItem control contains a single layer contained in a Grid control that serves as the layout root for the Pivot control.

Layer

Type

Description

Content

ContentPresenter

The ContentPresenter control that displays the PivotItem content.

Content

This is a standard ContentPresenter element used to serve as a placeholder for content.

Only PivotItem controls can be defined within the Pivot control. If you attempt to place another element into the Pivot control, it will be wrapped into a PivotItem control. The contents of a PivotItem control can either be specified in the XAML code or be added programmatically through its Content property.

See Also

Other Resources

Panorama control architecture for Windows Phone 8