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 http://msdn.microsoft.com/en-us/library/ff941126%28v=vs.92%29.aspx

+3


source to share


2 answers


FROM#

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

      



XAML

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

ItemContainerStyle="{StaticResource PanoramaItemStyle1}"

      

+8


source


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



+2


source







All Articles