Memory leak with WPF & ItemsControl (VB.NET)

Posted by Matt H. on Stack Overflow See other posts from Stack Overflow or by Matt H.
Published on 2010-05-04T21:47:29Z Indexed on 2010/05/11 8:04 UTC
Read the original article Hit count: 318

Filed under:
|
|
|
|

I have an ItemsControl that uses a DataTemplate to display properties in my customClass that implements INotifyPropertyChanged...

Pretty straightforward...

Some items in the DataTemplate use CommandBindings (such as buttons), and a few have some code-behind (yuck).

When I empty the ItemsControl and set all instances of customClass = Nothing , no memory is released from my program. This becomes a problem pretty quickly!

Any idea where I should start looking? I've even gone so far as to completely traverse the visual tree of each DataTemplate instance and set each Visual = Nothing. I'm not really if that's supposed to have any effect though.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about vb.net