Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are not binding to a <code>DependencyProperty</code> or a object that implements <code>INotifyPropertyChanged</code> then the binding can leak memory, and you will have to unbind when you are done.</p> <p>This is because if the object is not a <code>DependencyProperty</code> or does not implement <code>INotifyPropertyChanged</code> then it uses the <code>ValueChanged</code> event via the <code>PropertyDescriptors</code> <code>AddValueChanged</code> method. This causes the CLR to create a strong reference from the <code>PropertyDescriptor</code> to the <code>object</code> and in most cases the CLR will keep a reference to the <code>PropertyDescriptor</code> in a global table. </p> <p>Because the binding must continue to listen for changes. This behavior keeps the reference alive between the <code>PropertyDescriptor</code> and the <code>object</code> as the target remains in use. This can cause a memory leak in the <code>object</code> and any <code>object</code> to which the <code>object</code> refers, This includes the data-binding target.</p> <p>So in short if you are binding to a <code>DependencyProperty</code> or <code>INotifyPropertyChanged</code> object then you should be ok, otherwise like any subscribed event you should unsubscribe your bindings</p> <hr> <p><strong>Edit:</strong> There is a possibility this was fixed in .NET4.5 using Weak Events/References, But after a few quick tests it seemed the same to me, I will have to dive in more deeply to confirm, so I'll personally say in <strong>might</strong> be fixed in 4.5 :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload