wpf dependency property

1. understanding of the dependency property "taken from the holy canon -wpf self-study manual"

  Dependency property do not want simple object-oriented language attribute, it is more like a calculation process, after some additional calculations to obtain a final value based on the input. The whole calculation process "dependency" and other attributes of a variety of factors intrinsic and extrinsic.
  wpf design idea is that if property can solve the problem, not the use of methods and events. Thus, dependency properties and properties compared to the previous, provides a resource reference, style, animation, data binding, property value inheritance, integrated support function overloading and metadata wpf designer.
  Dependency property through four steps, i.e., the base value is determined, calculation, validation and animations as well as restrictions. Base value is a value calculated before dependency, mainly in terms of the relative calculation and animation; background value refers to a value obtained by the main wrapper or .net xaml attribute set directly in the code. If the attribute value is dependent on a resource or a data reference binding, also known as "local value."

2. dependency property precedence

No. name  Explanation
1 Limit or force (Coerce) If the dependency attribute is already registered CoerceValueCallback, you can modify the value of a property dependent on the implementation of the function to be modified
2 Animation If the animation is running, it can change the dependency property value
3 Local value  And the code value included directly in XAML, and dynamic resource references and data bindings  
4 Template parent  
5 Style flip-flops  
6 Template trigger  
7 Style settings  
8 Theme Styles  
9 Property value inheritance  
10 The default value of metadata  
11    

Guess you like

Origin www.cnblogs.com/wpfstudy/p/12232720.html