gpt4 book ai didi

c# - Silverlight 中的依赖属性

转载 作者:太空宇宙 更新时间:2023-11-03 14:19:21 24 4
gpt4 key购买 nike

我读了又读了 silverlight 中的依赖属性,但我仍然没有看到它的重要性。有人可以非常简单地向我解释什么是依赖属性以及您何时需要它以及为什么需要它吗?

最佳答案

这是 Dependency Property Overview on MSDN 的摘录,这应该比我以往任何时候都更优雅地回答你的问题:

The purpose of dependency properties is to provide a way to compute the value of a property based on the value of other inputs. These other inputs might include system properties such as themes and user preference, just-in-time property determination mechanisms such as data binding and animations/storyboards, multiple-use templates such as resources and styles, or values known through parent-child relationships with other elements in the element tree. In addition, a dependency property can be implemented to provide self-contained validation, default values, callbacks that monitor changes to other properties, and a system that can coerce property values based on potentially runtime information. Derived classes can also change some specific characteristics of an existing property by overriding dependency property metadata, rather than overriding the actual implementation of existing properties or creating new properties.

阅读full article了解更多详情

希望对你有帮助

关于c# - Silverlight 中的依赖属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5854116/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com