we are heavy-using your really great CinchV2.
But over the last week we ran into problems.
It seems like ViewModels are not correctly disposed, or I am completely wrong…
- I wrote a small Application (attached), with a MainView which has to display different views inside a ContentControl (or whatever)
- When you start the program, one view (UserControl1) is loaded inside this ContentControl => This view has a ViewModel called ViewModel1
- When you click “next”, the UserControl1 is disposed (correctly), but not the ViewModel1
- When you switch multiple times between these two views, every time the views is correctly disposed, but ONE instance of ViewModel1 is always staying.
There are no references to the viewmodel, which prevent to GC to collect this instance. The ViewModel is NOT marked as “Shared” it is explicitly NONSHARED.
I double-proofed with dotMemory from Jetbrains (a really great tool for such purposes). dotMemory showed me also, that your small DemoApplication from Cinch is closing the AboutViewModel correctly, when I close the AboutView with “x”.
Am I wrong, that the ViewModel should be disposed or am I doing something wrong?
Can you please be so kind to help me, or give me a small advice where I can look further?