Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caliburn.Micro: Views and Bootstrapper in different Projects

I am playing around with Caliburn.Micro an have a small problem. I like to have one project for the application starter, containing the bootstrapping, configuration files and so on. The UI of the application is then organized in an own project. This works fine with Prism but it seems to me that caliburn does not like it if the UI and bootstrapper are separated. Is this correct or do I miss some thing?

edit: I reference the bootstrapper in the app.xaml. The bootstrapper looks currently just like this:

public class AppBootstrapper : Bootstrapper<MainViewModel>
{
}

The ViewModel is in another project and the application window shows "Can not find view for view model..." when I start the application. This does not happen if ViewModel and View are in the same project like the bootstrapper.

like image 667
HerrLoesch Avatar asked Oct 05 '22 21:10

HerrLoesch


1 Answers

Override SelectAssemblies in the bootstrapper.

Turning logging on can be helpful, CM will tell you the name variations of a view or view model it's trying to locate:

if (Debugger.IsAttached)
     LogManager.GetLog = type => new DebugLogger(type);

more info: Is it possible to Create different pojects for Views, ViewModels and Models in a single solution

like image 97
Derek Beattie Avatar answered Oct 10 '22 03:10

Derek Beattie