8,735
社区成员
发帖
与我相关
我的任务
分享
Storyboard sb = new Storyboard();
DoubleAnimation ani = new DoubleAnimation();
ani.From = 0.5;
ani.To = 1;
ani.Duration = new Duration(TimeSpan.FromMilliseconds(100));
sb.Children.Add(ani);
// 上面的代码都还懂是什么意思。
// 下面就不懂了:
// 1. 这个 RigisterName 来自 FrameworkElement,请问这个 FrameworkElement 是什么意思?
this.RegisterName("lblText", lblText);
// 2. 这里为什么不用上面已经声明过的 sb,而是用 Storyboard 对象?
Storyboard.SetTargetName(ani, "lblText");
Storyboard.SetTargetProperty(ani, new PropertyPath("(UIElement.Opacity)"));
sb.Begin(this, true);