I have problem with memory leak when I tried to load the drawing brushes to the Button (I am using .Net 4). Basically We want to load a vector image to the button, we convert this vector image into a drawingbrush and saved it to the resourcedictionary file. And it causes memory leaks on System.Windows.Media.DrawingBrush and System.Windows.Media.RenderData, which it has system.eventhandler not released.
The code and memroy leak image are included into the attached files.
Can someone tell me what is going on and how to fix them?
Thanks a lot.