Has it ever been possible to bind to a field in WPF?

后端 未结 1 1360
难免孤独
难免孤独 2021-01-20 13:07

Someone suggested in another question that they, at some point, were able to bind a value to a field in WPF.

I know that this is not a supported scenario (and person

相关标签:
1条回答
  • 2021-01-20 13:10

    No. Binding in WPF uses either a PropertyDescriptor or the Dependency Property mechanism, which only works on Properties.

    (Technical note here: A Dependency Property is technically sort of a field - it's defined as a field, then registered with the DP system, though, and treated more like a property, so I would still call it a property... The field itself doesn't actually store the data in the case of a DP.)

    0 讨论(0)
提交回复
热议问题