The idea behind the weak reference is that you can keep a reference to an object, without preventing it to get garbage collected. In stead, when the object pointed to is collected, all weak references are set to null.
I have all confidence that this actually works. So if you are looking for the root cause for an object not being collected, you can safely ignore the Weak References. The WPF library objects may keep other non-weak references that are causing problems, and there are documented situations where this happens.
I used to have code to recursively remove all databindings, which had some ugly side effects so I asked this question. I can recommend you to follow the advice in @Kent's answer: make sure all binding is done relative to a single (or few) DataContext
properties, and set those to null. That should cleanly disconnect all WPF bindings depending on that DataContext
.