Tobias Moe Thorstensen
Tobias Moe Thorstensen

Reputation: 8981

Caliburn.Micro should I use Screen or Conductor.AllActive for my parent view

I have a parent view/viewmodel which has several ContentControls that are bound to other viewmodels. Consider the drawing beneath

enter image description here

We think we face a memory leak in our application when the parent window is destroyed since the memory isnt freed, we suspect that the "child" views are not destoryed along with the parent. Can this be the cause? Should the parent be of type Conductor.AllActive and deactive the items explicity or is Screen enough?

Upvotes: 2

Views: 327

Answers (1)

Jack Hughes
Jack Hughes

Reputation: 5664

I would use Conductor.AllActive because otherwise the lifecycle of your sub-screens is not being observed properly. You may find that the sub-screens are not activated properly. Whether using Conductor.AllActive will fix your memory leak, I don't know. Very easy to find out and whether it does or not I'd still use Conductor.AllActive your scenario is precisely the scenario it was designed for.

Upvotes: 2

Related Questions