Memory leak in WPF app due to DelegateCommand.
Posted
by Abdullah BaMusa
on Stack Overflow
See other posts from Stack Overflow
or by Abdullah BaMusa
Published on 2010-06-15T10:48:28Z
Indexed on
2010/06/15
10:52 UTC
Read the original article
Hit count: 500
I just finished desktop apps written in WPF and c# using MVVM pattern. In this app I used Delegate Command implementation to wrap the ICommands properties exposed in my ModelView. The problem is these DelegateCommands prevent my ModelView and View from being garbage collected after closing the view. So it stays larking until I terminate the whole application. I profile the application I find it’s all about delegatecommand that keeping the modelview in memory. How could I avoid this situation and is this in nature of mvvm pattern, or it’s about my implantation of the pattern?. Thanks
© Stack Overflow or respective owner