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 of PropertyMetadata. This can be an instance of the PropertyMetadata 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 from PropertyMetadata and adds:
IsAnimationProhibited – disable animations for this property?
FrameworkPropertyMetadata – derives from UIPropertyMetadata and adds:
AffectsArrange, AffectsMeasure, AffectsParentArrange, AffectsParentMeasure, AffectsRender – Should layout calculations be re-run after property value changes?
Read more: 2,000 Things You Should Know About WPF
QR:
0 comments:
Post a Comment