How to change WP Panorama element in full screen mode

I am trying to resize the content of a PanoramaItem so that it has no margins and stretches the full width / height of the screen. So far, I have been unable to modify a copy of the template. Negative margins can take care of the left / top, but the next pan item always peeks in from the right edge, and even if I manage to stretch the pan item, the next one will overlap on the right side of the screen.

Any ideas on how to change the panorama so that the actual panorama takes the whole screen (800x480) and the next panorama elements are always 480px on the left side of the previous panorama so that you can't see part of the next element.

Why do I want to change the panorama? Because the control has functionality built in that does everything I want to do (I am creating a full screen image viewer with flick gesture support). I just want the panorama to be full screen and then put the images inside, capturing the entire container size (full screen).

Panorama architecture


source to share

2 answers


public class PanoramaFullScreen : Panorama
    protected override System.Windows.Size MeasureOverride(System.Windows.Size          availableSize)
        availableSize.Width += 48;
        return base.MeasureOverride(availableSize);



<Style x:Key="PanoramaItemStyle1" TargetType="phone:PanoramaItem">
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
            <ControlTemplate TargetType="phone:PanoramaItem">
                <Grid Background="{TemplateBinding Background}" Margin="0,0,0,0">
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    <ContentControl x:Name="header" CharacterSpacing="-35" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" FontSize="66" FontFamily="{StaticResource PhoneFontFamilySemiLight}" HorizontalAlignment="Left" Margin="12,-2,0,38">
                            <TranslateTransform x:Name="headerTransform"/>
                    <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>

ItemContainerStyle="{StaticResource PanoramaItemStyle1}"




You can use Pivot with Heading Header and Heading Headers and not Panorama. And it will also support flick.



All Articles