Oct 12, 2012 at 10:29 PM
Edited Oct 12, 2012 at 10:36 PM
Thank you BladeWise, i tried all the options and it turned out ..... see below...
After doing some reverse engineering my code and stripping down one at a time, found the problem.
We open screens in a new tab, and we have a custom tab, list box -> list items acts as a tabs and beneath there is a content control which displays currently selected screen. Per business requirement we created a copy/paste behavior and attached to listbox
list item (textbloxk) using datatemplate.
It turned out that the behavior is the culprit, if i remove the behavior and i see screens being finalized properly. I googled and saw some posts suggesting that there is a leak with behaviors and suggested some solutions, but still no luck. Though it is
calling detach/unload, i see the behavior being detached but the object is not getting finalized.
I am not sure if this is the issue because of using behavior on a control that is databound/message.attach using caliburn micro? (I don't think but..)
here is the code that has the issue: https://skydrive.live.com/redir?resid=F034D77F7A7A272B!285&authkey=!ANtMIlvZGbC5pYY
I added Destructor on viewmodel and added log to output window to see if it getting finalized, and in couple of passes (not immediately after closing the screen though), i see its getting called.