WPF 动画结束时是否会触发任何事件?
WPF 动画结束时是否会触发任何事件?
void HideDefaultScreenImageTimer_Tick(object sender, EventArgs e)
{
HideDefaultScreenImageTimer.Stop();
var doubleAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.45)));
DefaultScreenImage.BeginAnimation(UIElement.OpacityProperty, doubleAnimation);
// I need some event when an animation ENDS and within that event I want to remove
// Image (DefaultScreenImage) from Canvas.
MainCanvas.Children.Remove(DefaultScreenImage);
}
Is there any event that fires when WPF Animation ends?
void HideDefaultScreenImageTimer_Tick(object sender, EventArgs e)
{
HideDefaultScreenImageTimer.Stop();
var doubleAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.45)));
DefaultScreenImage.BeginAnimation(UIElement.OpacityProperty, doubleAnimation);
// I need some event when an animation ENDS and within that event I want to remove
// Image (DefaultScreenImage) from Canvas.
MainCanvas.Children.Remove(DefaultScreenImage);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,有。
已完成的事件 (MSDN)。
所以你的代码变成:
Yes there is.
The Completed Event (MSDN).
So your code becomes: