- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道这些类之间的基本区别,当我们备份属性时使用 PropertyMetadata,当我们想要支持动画时使用 UIPropertyMetadata,以及用于用户控件中使用的框架属性的 FrameworkMetadata。
但我只了解理论部分。
如果你能解释一个最简单的例子,在 3 个不同的依赖属性中使用所有这 3 个类来清楚地区分它们,那将是一个很好的例子。
提前致谢。
最佳答案
来源:PropertyMetadata vs. FrameworkPropertyMetadata
When you implement a custom dependency property and you register the property by calling
DependencyProperty.Register
, you specify some metadata for the property by passing it an instance ofPropertyMetadata
. This can be an instance of thePropertyMetadata
class or an instance of one of its subclasses. The differences are shown below.
PropertyMetadata
– Basic metadata relating to dependency properties
CoerceValueCallback
– coerce the value when being setDefaultValue
– a default value for the propertyPropertyChangedCallback
– respond to new effective value for the property
UIPropertyMetadata
– derives fromPropertyMetadata
and adds:
IsAnimationProhibited
– disable animations for this property?
FrameworkPropertyMetadata
– derives fromUIPropertyMetadata
and adds:
AffectsArrange
,AffectsMeasure
,AffectsParentArrange
,AffectsParentMeasure
,AffectsRender
– Should layout calculations be re-run after property value changes?BindsTwoWayByDefault
,DefaultUpdateSourceTrigger
,IsDataBindingAllowed
,IsNotDataBindable
– Dictates how property participates in data bindingInherits
,OverridesInheritanceBehavior
– Does inheritance work for this property?Journal
– Store this value when journaling?SubPropertiesDoNotAffectRender
– Check properties of this object when layout changes?
关于wpf - WPF中的PropertyMetaData、UIPropertyMetadata、FrameworkMetaData有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14221636/
我知道这些类之间的基本区别,当我们备份属性时使用 PropertyMetadata,当我们想要支持动画时使用 UIPropertyMetadata,以及用于用户控件中使用的框架属性的 Framewor
在查看示例附加属性和行为时,我发现了 FrameworkPropertyMetadata、UIPropertyMetadata 和 PropertyMetadata 的混杂使用。既然它们都形成了继承层
我知道这是基本的,但我不明白。我只是希望使用 lambda 运算符将依赖属性 Dashes 初始化为双集合。 什么是正确的语法? 谢谢。 public static readonly Dependen
我是一名优秀的程序员,十分优秀!