WPF对某个元素进行淡入淡出

WPF对某个元素进行淡入淡出,例如对 ImagePage 元素进行淡入淡出,代码如下:

淡入

daV = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(1)));
this.ImagePage.BeginAnimation(UIElement.OpacityProperty, daV);

淡出

DoubleAnimation daV = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(1)));
this.ImagePage.BeginAnimation(UIElement.OpacityProperty, daV);

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注