gpt4 book ai didi

WPF/银光 : Attached Properties and Garbage Collection

转载 作者:行者123 更新时间:2023-12-04 06:27:44 24 4
gpt4 key购买 nike

假设我有一个文本框和一个名为 Foo.Bar 的附加属性。

<Textbox local:Foo.Bar="5" />

附加属性是否包含对文本框的强引用?

最佳答案

不,他们不应该,您可以将 DependencyObejcts 视为字典,将 Dependency/Attached 属性视为字典中的键。

OnBarChanged 可以对 TextBox 做任何它想做的事情,但它可能会在某处保留对它的强引用。

关于WPF/银光 : Attached Properties and Garbage Collection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5835945/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com