Does Binding work ONLY with DependencyProperty?

后端 未结 2 1789
别那么骄傲
别那么骄傲 2021-02-08 06:51

MSDN says,

  • Each binding typically has these four components: a binding target object, a target property, a binding source, and a Path to th

2条回答
  •  醉话见心
    2021-02-08 07:29

    The XAML is setting Setter.Value to an object of type Binding. The Style thus created then sets the Text dependency property on the target object to that Binding, so that the binding will update Text whenever the source property changes.

    If Setter.Value were a dependency property, then the setter would end up being an intermediary in property-change notification: the source property changes, the binding notifies the setter, the setter notifies the target. Since it's just a CLR property, the setter's not actually involved in change notification: the source property changes and the binding notifies the target.

提交回复
热议问题