This project is read-only.

Project Setup

There are a couple of simple steps you must follow when getting started with Caliburn.
  1. If you have not already obtained and built the code, please go ahead and do this now.
  2. Create a new WPF/SL application or open an existing application.
  3. Add references to Caliburn.Core, Caliburn.RoutedUIMessaging, Caliburn.Actions, and Caliburn.Commands (depending on the features you need).
  4. Open the App.xaml.cs file in your project.
  5. Add the following using (vb: import) statements to this class: Caliburn.Core, Caliburn.RoutedUIMessaging, Caliburn.Actions, Caliburn.Commands
  6. For WPF, add the following code to the constructor. For Silverlight add the following code to the beginning of the Application_Startup method:


As you can imagine, this simply configures the core framework and the various features for use in your application. That's all you need to do to get started!

More advanced users may wish to customize Caliburn's configuration. There are a variety of ways to do this. Each "With" method returns a class with specific methods related to configuring that piece of the framework. Essentially, Caliburn is a collection of UI services that work together to solve complex problems. Any of its services can be switched out with custom implementations, but this should be rarely necessary, if ever. This ability is powered by Caliburn's deep usage of dependency injection through an extensible mechanism for dependency injection containers. Caliburn provides it's own simple implementation of a DI container, which it uses by default. However, it can be replaced easily by implementing the IServiceLocator interface (you should also implement IConfigurator or provide a delegate which can configure the container with the provided components). Caliburn provides implementations for Windsor(Caliburn.Windsor), StructureMap(Caliburn.StructureMap), String.NET(Caliburn.Spring) and Unity(Caliburn.Unity) out of the box. Below is an example of using Windsor with Caliburn as well as some custom configuration:

public partial class App : Application
    public App()
        //Note: Using an external container via adapter.  The usage pattern is the same for all supported containers.
        var container = new WindsorContainer();
        var adapter = new WindsorAdapter(container);
        //Note: Retrieve one of Caliburn's services.
        var controller = container.Resolve<IRoutedMessageController>();
        //Note: Customize the default behavior of button elements.
            new GenericInteractionDefaults<Button>(
                (b, v) => b.DataContext = v,
                b => b.DataContext

Last edited Feb 4, 2009 at 12:29 AM by EisenbergEffect, version 13