3

I have an application that I am currently working on and there is a requirement to change the view based on an event occurring. This event means that the same ViewModel must be used but using a different View. I do not currently know if this is possible to do with Caliburn but I imagine it should be. the main problem I am having is the convention over configuration element of Caliburn. Example:

I have a ViewModel "MainViewModel" and it is bound to "MainView" through convention. When the event occurs I want the application to be displaying "MainView2" instead of "MainView". I can imagine there is a programmatic way of setting this but my inexperience with Caliburn is a problem.

stuartmclark
  • 1,203
  • 13
  • 22

1 Answers1

6

You can control which View is used for your ViewModel by setting cal:View.Context property on ContentControl that shows the view.

Have a look here.

Community
  • 1
  • 1
gius
  • 9,289
  • 3
  • 33
  • 62