How is dependency property implemented?

≡放荡痞女 提交于 2020-01-13 09:43:28

问题


Can anyone explain how is dependency property implemented? Is it just a static dictionary that is declared in base class with a reference of given instance as a key?I can't find any resources about this in internet...
Thanks a lot


回答1:


I see two questions:

  1. How do dependency properties work? The MSDN article on Properties in WPF is a great series on dependency properties. Should be a good overview to get you started.
  2. How are dependency properties implemented? You won't find any resources on this because why would Microsoft want to expose their implementation of DP? That being said, that's certainly open to discussion.



回答2:


...a few years later.

and there is already a source code browser for .NET. You can study how it is implemented here: DependencyProperty.cs



来源:https://stackoverflow.com/questions/880950/how-is-dependency-property-implemented

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!