如何最轻松地确定某个属性是否为依赖项属性? [英] How can I most easily determine whether a property is a dependency property?
问题描述
我最近在将数据绑定到DataGridTextColumn的Visibility属性时遇到问题。之所以引起混乱,是因为该属性在WPF中是一个依赖属性,而在Silverlight中却不是。
I recently had an issue with databinding to the Visibility property of a DataGridTextColumn. The confusion arose because this property is a dependecy property in WPF but not in Silverlight.
我认为MSDN文档并不十分清楚。以下是WPF的唯一相关文本。
I don't think that the MSDN documentation makes this very clear. The following is the only related text for WPF.
有关可影响该值的信息,请参阅DependencyProperty。
"For information about what can influence the value, see DependencyProperty."
推荐答案
相关性属性在其定义的类上具有一个对应的静态字段。请查看 DataGridTextColumn 类。
Dependency properties have a corresponding static field on the class they are defined in. Have a look at the fields section of the DataGridTextColumn class.
这篇关于如何最轻松地确定某个属性是否为依赖项属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!