Another nested conductor/Screen Activate Design Question

Topics: Framework Services
Aug 5, 2011 at 10:57 PM

Just wondering what the best practice is for setting nested Screens / Conductors to Active when the parent viewModel is not a conductor..  I understand, finally, about how the ActiveItem of a conductor isn't IsActive=true unless the conductor is active.  The scenario I have found myself in is that I have a base class with lots of inherited logic that most times is just a screen and ultimately inherits from Screen.  However I have a few scenarios (more and more) where I want to divide up the view to have different children and/or act like a conductor.

One of the things I have started doing is creating a BaseConductorViewModel as a child in my BaseViewModel.  However I was having issues with activation and realized that I'm not actually making BaseConductorViewModel active.  I know I can do some simple things like (BaseConductorViewModel as IActivate).Activate but that seems a bit wrong.

Or do I have a design flaw that everything should be a conductor until the very bottom?

Hope that makes sense.


Aug 5, 2011 at 11:07 PM

I believe this is what I needed - seems to be working:


Aug 5, 2011 at 11:31 PM
Edited Aug 5, 2011 at 11:31 PM

In simple cases, where a cascaded activation is just what you need, that extension (or ActivateWith/DeactivateWith) is just what you need (and what I use too).