开发者

WPF/Silverlight: Why do animation classes require dependency properties?

开发者 https://www.devze.com 2022-12-11 22:40 出处:网络
Why do animation classes (like DoubleAn开发者_如何学运维imation) require dependency properties?Dependency properties have a lot of overhead when compared to a simple property.Wouldn\'t passing in an o

Why do animation classes (like DoubleAn开发者_如何学运维imation) require dependency properties? Dependency properties have a lot of overhead when compared to a simple property. Wouldn't passing in an object and property name and using to reflection to retrieve a setter delegate have made the animation classes more flexible and generally more usable? It would still have facilitated dependency properties, but would have the advantage of not requiring them.


Because you can set them with SetValue and GetValue instead of having to do all the reflection stuff to find and set the property.

0

精彩评论

暂无评论...
验证码 换一张
取 消