【发布时间】:2013-07-01 12:51:01
【问题描述】:
我是 Metro 风格应用程序开发的新手,我为上下动画创建了故事板。
<UserControl.Resources>
<Storyboard x:Name="up_animation" >
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid1">
<EasingDoubleKeyFrame KeyTime="0" Value="-1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-509"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Name="down_animation" >
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid1">
<EasingDoubleKeyFrame KeyTime="0" Value="-508"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="30"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
在我的完成按钮 Taped 事件中,我添加了此代码
private void Image_Tapped_1(object sender, TappedRoutedEventArgs e)
{
down_animation.Begin();
}
但它会抛出异常
{System.Exception: Unspecified error
at Windows.UI.Xaml.Media.Animation.Storyboard.Begin()
at Keypaddesign.samp.mykey_done_Taped_1(Object sender, EventArgs e) in e:\WorkArea\Keypaddesign\Keypaddesign\samp.xaml.cs:line 95}
如何解决这个问题。
【问题讨论】:
标签: c#-4.0 microsoft-metro windows-store-apps