Can bindings create memory leaks in WPF?

前端 未结 3 1055
醉酒成梦
醉酒成梦 2020-11-30 22:18

Do I need to unbind items as the item disappears in order to prevent memory leaks? I guess I\'m just a little worried that if I reload and a new template is applied to a con

3条回答
  •  情话喂你
    2020-11-30 22:21

    From http://msdn.microsoft.com/en-us/library/aa970850.aspx, WPF uses Weak Event Patterns, which do not hold strong references to objects and allow them to be GC'ed if they are the only references to an object.

    "Many aspects of WPF data binding already have the weak event pattern applied in how the events are implemented."

提交回复
热议问题