依赖属性是如何实现的?

发布于 2024-07-22 07:19:31 字数 83 浏览 3 评论 0原文

谁能解释一下依赖属性是如何实现的? 它只是在基类中声明的静态字典,并以给定实例的引用作为键吗?我在互联网上找不到任何关于此的资源...
非常感谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不弃不离 2024-07-29 07:19:31

我看到两个问题:

  1. 依赖属性如何工作? 有关 WPF 中的属性的 MSDN 文章是一个关于依赖属性的精彩系列。 应该是一个很好的概述,可以帮助您入门。
  2. 依赖属性是如何实现的? 您找不到任何与此相关的资源,因为 Microsoft 为什么要公开他们的 DP 实现? 话虽如此,这当然值得讨论。

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.
并安 2024-07-29 07:19:31

...几年后。

并且已经有一个.NET 的源代码浏览器。 您可以在此处研究它的实现方式:DependencyProperty.cs

...a few years later.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文