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);
发表回复