可能重复:
如何实现添加/删除列表项的淡入和淡出
LayoutStates
当我删除我的项目时,我尝试FrameworkElement.Unloaded
制作动画,但它不起作用。
我认为该项目在执行动画之前已被删除!
有谁知道解决方案?
<EventTrigger RoutedEvent="FrameworkElement.Unloaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.6"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1.6"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="grid">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.6"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1.6"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>