Search code examples
c#visual-studioxamlwindows-phone-8panorama-control

Add Panorama Item to Panorama Page


By default when you setup a panorama page on windows phone it gives me 2 pages "item one" and "item two" and I can scroll between these pages. But when I try and manually add another page (item 3) it doesn't scroll through a 3rd page instead it just sits on top of item1 and I cannot move it at all.

this is what the Visual studio template gives you:

        <!--Panorama item one-->
        <controls:PanoramaItem Header="item1">
            <Grid/>
        </controls:PanoramaItem>

        <!--Panorama item two-->
        <controls:PanoramaItem Header="item2">
            <Grid/>
        </controls:PanoramaItem>
    </controls:Panorama>
</Grid>

Is it possible to have over 2 panorama pages through XAML?

-Thanks


Solution

  • By pages here you mean PanoramaItems, Yes you can have multiple PanoramaItems.

    <Grid x:Name="LayoutRoot">
        <phone:Panorama Title="my application">
    
            <!--Panorama item one-->
            <phone:PanoramaItem Header="item1">
                <Grid/>
            </phone:PanoramaItem>
    
            <!--Panorama item two-->
            <phone:PanoramaItem Header="item2">
                <Grid/>
            </phone:PanoramaItem>
    
            <phone:PanoramaItem Header="item3">
                <Grid/>
            </phone:PanoramaItem>
    
            <phone:PanoramaItem Header="item4">
                <Grid/>
            </phone:PanoramaItem>
        </phone:Panorama>
    </Grid>
    

    Also read this Panorama Design Guideline for more details