Bill
Bill

Reputation: 1563

How to make a conductor "conduct"?

I'm new to CM, but it seems that the Conductor is an appropriate pattern to manage the screen workflow of an application. I haven't figured out how to make the conductor, well, "conduct" what screens are displayed beyond the initial screen.

I'm looking for a place to hook into CM's conductor that will detect when a screen is dismissed. Once a screen is dismissed I can call out to a state-machine like class that decides what Screen should be displayed next. This way each screen is unaware of the other screens in the application.

ie: Startup with a login screen, user logs in, conductor gets a "screen deactivated" notification and then asks a component what screen it should display next.

Upvotes: 1

Views: 293

Answers (1)

Jone Polvora
Jone Polvora

Reputation: 2338

Assuming your shellviewmodel inherits from a ConductorBase, the current view is bound to the ActiveItem property. To conduct, you must call ActivateItem and DeactivateItem existing methods on shell. This will trigger the magic of conducting views, deactivating and activating viewmodels.

Upvotes: 2

Related Questions