请问,FrameworkElement 是干嘛的

davidtsui 2012-08-04 09:48:28
我写了一个动画代码


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);



以上两个问题,求解~!
...全文
333 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
pavee 2012-08-04
  • 打赏
  • 举报
回复
FrameworkElement is the final stop in the core WPF inheritance tree. It implements some of the members that are merely defined by UIElement. For example, UIElement sets the foundation for the WPF layout system, but FrameworkElement includes the key properties (such as HorizontalAlignment and Margin) that support it. It also adds support for data binding, resources, animation, and styles, all of which are core features. In addition, FrameworkElement is the base class of Control class which defines elements that can interact with the user.
assky124 2012-08-04
  • 打赏
  • 举报
回复
1.基类
2.静态方法

后台代码先学下基础的C#知识

8,735

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧