Setting Up Caliburn.Micro MVVM

This is a fairly lengthy post that shows how to set up an initial MVVM WPF form using Caliburn.Micro.

Let’s get started, we’ll open up Visual Studio and chose to create a new WPF:

Visual Studio -> New Project -> WPF App (.Net Framework)

I usually set the project name to something like WPFUI and my solution name to be something like MVVMProject or the actual product name. For example, Microsoft might use Microsoft Outlook. Probably not, but you get what I’m saying…



First I will add Caliburn.Micro to my project. To do this go to Solution Explorer -> References -> Add NuGet Packages and search for Caliburn.Micro:



Now we can delete the MainWindow.xaml



Create a Views and ViewModels folder. This is where your viewmodels and views will call home.



Create a new class in the ViewModels folder and call it ShellViewModel and make it public. You’ll also want to inherit from screen and add the using statement for Caliburn.Micro:


Create a new window in the Views folder and call it ShellView


Create a new class in the root directory called Bootstrapper and inherit from BootstrapperBase and add the using statement for Caliburn.Micro


In App.xaml remove the StartupUri element and add the bootstrapper class as a resource by adding:

            <local:Bootstrapper x:Key="Bootstrapper" />

Your app.xaml should look like this:



Now go back into your Bootstrapper class and add the following:

public Bootstrapper()
protected override void OnStartup(object sender, StartupEventArgs e)

You’ll also need to add a using statement for System.Windows and ProjectName.ViewModels.

The program should now launch and show an empty white screen with “ShellView” as the window’s title. This is the first entry into a hopefully long series into the world of Caliburn.Micro.

Enjoy! 😊