I have a child branch with a linked virtual machine that is created every time I ask to open a child window. When a child branch opens, it registers a listener for the MVVM Light message. After I close the window, I am sure that I will release all references to it, but in fact I do not call dispose, because it does not implement IDisposeable.
When I initialize another child window of the same type and send it a different context, I know that I get a message from the previous instanciation of the virtual machine ... every time I use the window, more and more VMs listen and the code repeats.
How can I be sure that my previous virtual machine registered to listen to the message was really released and is no longer active. Is there a deterministic way to do this?
source
share