I am trying to create a pageFlip animation. Now, on a napkin, a gesture myStoryboard.Begin()is called.
The animation starts with the code, but the animation does not appear on the screen. But if I turn off the window and go back (say 5 seconds after it was called myStoryboard.Begin(), then the animation will be visible (starting from the 5th second), as if the Storyboard was working as usual.
<Storyboard x:Name="myStoryboard">
<DoubleAnimation
Storyboard.TargetName= "RightPageImageOverlay"
Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)"
EnableDependentAnimation="True"
From="0" To="10" Duration="0:0:10" />
</Storyboard>
Picture:
<Grid Grid.Row="1" x:Name="flipViewGrid" >
<Canvas x:Name="flipViewCanvas" >
<WebView x:Name="flipViewWebView" NavigationCompleted="WebView_NavigationCompleted" Source="http://127.0.0.1:2121" Height="{Binding ElementName=flipViewCanvas, Path=ActualHeight}" Width="{Binding ElementName=flipViewCanvas, Path=ActualWidth}" Canvas.Left="0" Canvas.Top="0">
</WebView>
<StackPanel Orientation="Horizontal" Canvas.Left="0" Canvas.Top="0" Canvas.ZIndex="1">
<Image x:Name="LeftPageImageOverlay" Height="{Binding ElementName=flipViewCanvas, Path=ActualHeight}" Width="{Binding ElementName=flipViewCanvas, Path=ActualWidth }" Loaded="PageImageOverlay_Loaded" ></Image>
<Image x:Name="RightPageImageOverlay" Height="{Binding ElementName=flipViewCanvas, Path=ActualHeight}" Width="{Binding ElementName=flipViewCanvas, Path=ActualWidth }" Loaded="PageImageOverlay_Loaded" ManipulationMode ="All" ManipulationCompleted="RightPageImageOverlay_ManipulationCompleted" ManipulationDelta="RightPageImageOverlay_ManipulationDelta" >
<Image.Projection >
<PlaneProjection RotationY="0" CenterOfRotationX="0" x:Name="flipViewPlaneProjection"/>
</Image.Projection>
</Image>
</StackPanel>
</Canvas>
</Grid>
Update: I have expanded the context of the image. How the code should work, as follows. When it is loaded FlipViewWebView, 2 screenshots of the left and right half of the page are taken and laid over FlipViewWebView. When a finger motion is detected, it is myStoryboardplayed. Below is the code that starts the page flipping animation when scrolling.
private void RightPageImageOverlay_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (e.Velocities.Linear.X > .5 || e.Velocities.Linear.X < -.5)
if (myStoryboard.GetCurrentState() == Windows.UI.Xaml.Media.Animation.ClockState.Stopped)
myStoryboard.Begin();
Debug.WriteLine("Velocity : " + e.Velocities.Linear.X.ToString());
}
2: , , - , , . , .