Handle navigation between screens

Jan 31, 2011 at 7:00 AM


I'm investigating if we should use CM for our Silverligth app and have a question.

I have two screens in a usecase flow. The first screen (S1) is a search screen where it's possible to select a search result and then the second screen (S2) should be shown with info from S1 and on this screen I can then edit this info. S1 and S2 have their own view models and they shouldn't know anything about each other. Should I have a screen conductor class to handle the flow? Note that this class doesn't have a corresponding view, it should only handle the navigation between the views. If I hadn't used CM then I would have implemented a controller class for this with OnSearchResultSelected (from S1) and then show S2.

I have looked at the documentation http://caliburnmicro.codeplex.com/wikipage?title=Screens%2c Conductors and Composition&referringTitle=Documentation but what I can see the conductor should have a view (ShellView) also.

Any hints for this case?

Jan 31, 2011 at 2:03 PM

I would use a conductor, yes. However, the view for the conductor would just contain a ContentControl. This question is, where are you going to show these two screens? That is the view for the conductor. Now, you could do this in other ways and without a view for the conductor and just use the conductor to manage the screens, but then you will have to wire up something so that the views actually stay synchronized with the view models.