locked
Dependency Property chains - Does Microsoft do graph analysis? RRS feed

  • Question

  • If I have three dependency props all linked in a one-way chain.
    • A is defined in an Parent UIElement (the scale value of a RenderTransform
    • B is getting that value in the child via the {RelativeSource} binding mechanism (and this is in a resour
    • C in an Element in the body of the child. It is getting it from B (via one-way) by simple {Binding} to the a DynamicResource in the resources {Biding Source={DynamicResource B}
    Am I going to get in trouble? How long can the chain be? Does it help that this is one-way, or is the end result indeterminate (which is what I suspect) because if I have 10 values all chained this way, I really wonder if the Dependency Engine does graph analysis to make sure that the chain values propagate to the edges properly.

    Tuesday, June 2, 2009 1:00 PM

Answers

  • Hi,

     

    -->Am I going to get in trouble? How long can the chain be? Does it help that this is one-way, or is the end result indeterminate (which is what I suspect)

     

    As far as I know, the length of the binding chain is not limited in WPF. The mode of the binding is depends on your real scenario, if you want the latter value is determined by the former value as a chain, you can set the one-way mode, otherwise, you can modify the binding mode as you want. However, if the chain hierarchy is somewhat long, you need to have a clear understanding of the entire binding chain to prevent unexpected effect that you do not want to get.

     

    -->because if I have 10 values all chained this way, I really wonder if the Dependency Engine does graph analysis to make sure that the chain values propagate to the edges properly

     

    So far the Dependency engine does not have such graph analysis as I know.

     

    Hope this helps.

    Thanks.


    Jim Zhou -MSFT
    Monday, June 8, 2009 8:04 AM