Memory Leak in PanelDragDropTarget
While implementing drag-and-drop grouping for the Silverlight DataGrid I noticed that the PanelDragDropTarget contains a memory leak:
Whenever you add a user control containing a PanelDragDropTarget to a page and then remove the user control from this page, the user control is not properly released.
When you replace the PanelDragDropTarget with another control, e.g. a ListBox, the user control is released.
The root cause of this problem is probably the fact that the base class DropDragTarget attaches some events to the Canvas of the Application.Current which are not removed.
I have created a sample project that demonstrates the problem using the MemoryLeakDetector which can be downloaded here.
This issue has been reported to the Silverlight Toolkit team here where you can vote for this issue to be solved.

Tweets that mention On developing Pochet.NET» Blog Archive » Memory Leak in PanelDragDropTarget -- Topsy.com said:
Oct 16, 10 at 9:36 pm[...] This post was mentioned on Twitter by Silverlight News, silverlightrays. silverlightrays said: Memory Leak in PanelDragDropTarget – http://bit.ly/bYBshi http://ff.im/-s9IWA [...]
emi said:
Jan 12, 11 at 11:41 pmDid you find any solution to this problem?
Emiel said:
Jan 13, 11 at 3:55 pmNo, unfortunately not. I am hoping that a new release of the Silverlight Toolkit will fix this problem, but I have no idea when a new release is planned.
In the meantime, all you can do, besides digging in the Toolkit source and try to solve the problem yourself, is to vote for the problem to be solved here.
If you find any other solutions, please let me know.
Emiel said:
Nov 03, 11 at 10:19 amtrenttrobler has posted a solution here.