saikamesh
saikamesh

Reputation: 4629

How to disable panorama default animation

When we navigate to a page that has a panorama control. It shows a slide animation from right to left. How do we disable this default animation of panorama ?

Upvotes: 1

Views: 1394

Answers (2)

Quincy
Quincy

Reputation: 1730

Doesn't look like there is a good way of doing it. Here is how I worked around it though. Basically set the opacity to 0 until the animation is complete while you have the pano background & title showing behind the actual pano.

<Grid x:Name="LayoutRoot">

    <Image Source="{Binding BackgroundUri"></Image>
    <Image Source="{Binding Title}"></Image>


    <controls:Panorama x:Name="Panorama" ... />

    <Grid.Triggers>
        <EventTrigger RoutedEvent="Grid.Loaded">
            <BeginStoryboard>
                <Storyboard >
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Panorama">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Grid.Triggers>
</Grid>

Upvotes: 1

Claus J&#248;rgensen
Claus J&#248;rgensen

Reputation: 26347

You don't. Unless you want to rewrite the PanningLayer control from scratch. And really, why would you want to do that? It's against the default platform UX.

Upvotes: 3

Related Questions