Our team is developing an application using WPF with MVVM.We want to make ViewModels reusable. With this intention we want to abstract the transition logic between Views (ViewModels, we use ViewModel-first approach with Caliburn.Micro) so the other application can override it.For instance, we have App1 and App2. Firstly, we developed App1 and it has FooViewModel which creates FunViewModel when user clicks a Next button.But, developing App2 we want to get to NotFunViewModel instead of FunViewModel when user makes a click on a Next button.How to accomplish such a task? The solution has to be universal and safe in accordance to types (in compile-time).
How to abstract transition between Views?
design patterns;wpf;patterns and practices;design
I usually use a ParentViewModel to control the application flowThe simplified version of it typically looks something along these lines:App1ViewModel{    BaseViewModel CurrentView { get; set; }    ICommand NextCommand { get; } <!-- will set CurrentView to FunViewModel -->}App2ViewModel{    BaseViewModel CurrentView { get; set; }    ICommand NextCommand { get; } <!-- will set CurrentView to NotFunViewModel -->}<ContentControl Content={Binding CurrentView} /><Button Command={Binding NextCommand} />