The Pivot
is composed of two distinct sections: a header list and a PivotItem
presenter (see Figure 11.4).
The Pivot
headers are displayed using a PivotHeadersControl
. The active PivotItem
has its header highlighted. Inactive PivotItems
have their headers displayed until the headers exceed the width of the control. If there are too few headers to take up the full width of the control, the headers do not loop, and each header is displayed only once.
PivotItems
are displayed using an ItemsPresenter
. PivotItem
is a ContentControl
playing host to a single item of content. A ContentPresenter
is used to display the content of the PivotItem
.
Only PivotItem
controls can be defined within the Pivot
control. If you attempt to place another element type directly within the Pivot
control, in XAML, an InvalidOperationException
is thrown when the Pivot
is initialized. This is contrary to the official Microsoft documentation on MSDN, which states that an element other than a PivotItem
is implicitly wrapped into a PivotItem
control.
The contents of a PivotItem
control can either be specified in XAML, or added programmatically through the PivotItem
’s Content
property.
52.15.231.106