using caliburn in a wpf user control

Topics: Getting Started
Jun 20, 2012 at 9:59 PM

Hi, I'm trying to create a wpf user control library and would like to use caliburn.micro to help me with MVVM.

My main user control gets instantiated through the view and I have no control over that. I tried adding "new AppBootstapper()" after my InitializeComponent() call in the user controls code behind but it doesn't seem like its working. The Configure method never gets called in the bootstrapper. Does caliburn work with wpf user control library projects? If so can someone point me in the right direction please :)

 

Jun 21, 2012 at 2:08 PM

Whenever I want to use CM in a class library type project I usually only put the Views and ViewModels and whatever misc. code I need there. Then for every main project in the applications I use it in I create a new bootstrapper following the tutorials. For example, in a recent project I have a main project (MyApplication), a class library (MyClasses), and a few other projects that act as modules.

MyApplication contains the Bootstrapper and ShellView while each module project contains a different other View/ViewModel. The MyClasses project contains a singleton to manage session data across all the projects as well as various globally available View/ViewModels such as commonly used dialogs.