应用程序崩溃与动画。 [英] App crash with animation.
问题描述
嗨!
我的应用程序中央图像具有旋转动画,如秒钟。
I have an application with a central image that have an rotate animation like seconds of clock.
< span class ="x_x_hps">在wp7中,应用程序
正常,我尝试在w8中移植,但只是第一个代码产生问题。
我尝试使用xaml动画,动画来自代码,绑定和代码轮换但是经过一段时间(有时10''othertimes 200'')应用程序崩溃并且没有调试错误。
I try with a xaml animation, animation from code, binding and code rotation but after some time (sometimes 10'' othertimes 200'' ) the app crash and not have debug error.
我在Windows事件中只有一个非常奇怪的报告。
I have only a report in windows event very strange.
现在我创建一个简单明了的项目,但遇到同样的问题。
Now I create a clear and simple project, but have the same problem.
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="TestAnimation.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestAnimation"
xmlns:common="using:TestAnimation.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<UserControl.Resources>
<!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
<x:String x:Key="AppName">My Application</x:String>
<Storyboard x:Name="ClockStoryboard">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="SecondiR" RepeatBehavior="Forever" >
<SplineDoubleKeyFrame KeyTime="0:1:0" Value="360" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
<!--
This grid acts as a root panel for the page that defines two rows:
* Row 0 contains the back button and page title
* Row 1 contains the rest of the page layout
-->
<Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Back button and page title -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
<TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/>
</Grid>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,12,0" >
<Image x:Name="SecondiR" VerticalAlignment="Center" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Source="Images/Tron/Secondi.png" >
<Image.RenderTransform>
<CompositeTransform x:Name="SecondiRTrasform"/>
</Image.RenderTransform>
</Image>
</Grid>
<VisualStateManager.VisualStateGroups>
<!-- Visual states reflect the application's view state -->
<VisualStateGroup>
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>
<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
<VisualState x:Name="FullScreenPortrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<!-- The back button and title have different styles when snapped -->
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</common:LayoutAwarePage>
你能帮助我吗?
Can you help me?
推荐答案
我嘲笑了类似于你的简化示例,并没有看到崩溃。你是如何开始动画的?
I mocked up something similar to your simplified example and did not see a crash. How are you starting the animation?
这篇关于应用程序崩溃与动画。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!