Each PanoramaItem
control represents individual sections of content. The PanoramaItem
is itself composed of two parts: a header part and a content part. Each part is contained within a Grid
that serves as the layout root for the PanoramaItem
control.
The contents of a PanoramaItem
can either be specified in XAML, or added programmatically using its Content
property.
The headers of all PanoramaItems
can be uniformly customized by using the Panorama
’s HeaderTemplate
property. This works in the same manner as the example for the Pivot
in the previous section.
You can hide a PanoramaItem
by setting its Visibility
property to Collapsed. This can be useful when you need to conceal an item before it has loaded some other resource.
Tip
As mentioned earlier in the chapter, when a Panorama
loads, all Panorama
items undergo a render pass. Thus, a Panorama
with too many items may take a long time to load. Alternatively, to improve performance, where reducing the number of items is not an option, consider delay loading controls and content. Unlike the Pivot
, however, the Panorama
does not have load events (such as the LoadingPivotItem
event), which further underscores the differences between the purpose and nature of the two controls. If you find that the Panorama
’s performance is not up to scratch, it may indicate that your content is not suited to the Panorama
and that a different control or approach is needed.
The Orientation
property of the PanoramaItem
affects how content is snapped into place during a pan gesture. The default value of the Orientation
property is Vertical. By setting the property to Horizontal
, the user is able to pan around the content without snapping a PanoramaItem
into place. A horizontal orientation also allows for the content to be placed off the screen instead of being clipped. This reinforces the panoramic nature of the control.
3.16.166.3