silverlight 和 WPF 中的Storyboard和DependencyProperty的区别
来源:互联网 发布:淘宝怎么领取红包 编辑:程序博客网 时间:2024/06/15 05:33
前几天做了一个WPF的项目,代码是从silverlight中拷出来的,但是运行时出现了很多错误,原因在于silverlight和WPF之间有很多区别之处,在此总结一下
1.在后台根据前台xaml文件的x:Name 来获得控件
silverlight中:
Panel panle = this.LayoutRoot.FindName(account.Parent.Attribute("ID").Value) as StackPanel;
WPF中:
Panel panle = LogicalTreeHelper.FindLogicalNode(this.LayoutRoot, account.Parent.Attribute("ID").Value) as Panel;
2.动画Storyboard 和依赖属性 DependencyProperty 有锁定的问题
在silverlight 没有锁定问题,可以在storyboar_Complate 中可以对DependencyProperty 属性进行赋值
在WPF中,则两者有锁定问题,在storyboar_Complate 中必须对Storyboard 置空,然后才能对DependencyProperty属性进行赋值,否则无法赋值成功
解锁属性 的相关代码为: brdRoot.BeginAnimation(FrameworkElement.HeightProperty, null);
在这就是简单的总结一下,但是原理性很强,为了这个问题浪费了很长的时间,并且请教了高手帮助,这对我以后的代码编程道路提供了很大的帮助,呵呵~~~
- silverlight 和 WPF 中的Storyboard和DependencyProperty的区别
- silverlight 和 WPF 中的Storyboard和DependencyProperty的区别
- WPF和Silverlight区别
- Winform、WPF和silverlight的区别
- WCF、WPF、Silverlight和区别
- WCF、WPF、Silverlight和区别
- WCF、WPF、Silverlight和区别
- WPF、Windows Forms和Silverlight间的联系和区别
- WPF、Windows Forms和Silverlight间的联系和区别
- WPF、Windows Forms和Silverlight间的联系和区别
- WPF、Windows Forms和Silverlight间的联系和区别
- WPF、Windows Forms和Silverlight间的联系和区别
- WPF、Windows Forms和Silverlight间的联系和区别
- #18 – Silverlight and WPF Differences(Silverlight和WPF的区别)
- WPF和Silverlight的关系
- WPF和Silverlight的关系
- WPF和Silverlight的关系
- WPF和Silverlight的关系
- hive安装配置
- 目录浏览及大文件在内存中的读写
- 在 Flex 应用程序中使用 AnyChart
- 在Style中将EventTrigger与Trigger同时使用
- JJTree
- silverlight 和 WPF 中的Storyboard和DependencyProperty的区别
- du and df 命令区别
- java 移动MAS的DB接口实现彩信发送
- Mysql中级联删除问题
- Windows phone 7 点滴 —— 性能问题
- 编程方法学 - 公开课学习笔记(二)
- 页面间传递数据的方式,使用Event
- c# 多线程 源码 6 总结
- Oracle 优化原理