Sampels...

Jul 6, 2010 at 6:28 AM

It looks great.

I am not familiar with Caliburn. but Caliburn.Micro is looking very useful for developing WP7 apps.

Can you add a little sample of how to setup the framework, I can't wait for your next blog post.

Coordinator
Jul 6, 2010 at 1:04 PM
The blog post is coming today or tomorrow. But to get things setup, you should inherit from Bootstrapper<TRootModel> abd replace the generic type with your "shell" VM. You can override methods on the bootstrapper to plug in your IoC container. Add an instance of your bootstrapper to the Application.Resources (be sure to give it a key). Create a view for your VM. The View and VM should be named the same except that all instances of the word ViewModel in the namespace/type should instead be only View. So MyApp.ViewModels.ShellViewModel would become MyApp.Views.ShellView. Run your application.
Jul 6, 2010 at 1:33 PM

Hi, thanks for the response. 

I do all of the above, my code in the App.xaml:

<Application x:Class="Caliburn.Micro.Sample.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml"
             xmlns:local="clr-namespace:Caliburn.Micro.Sample">
    <Application.Resources>
        <local:SampleBootstrapper x:Key="Bootstrapper"/>
    </Application.Resources>
</Application>
But the bootstrapper instance is not created, putting it in the resource dictionary is not enough.  What I am missing?

Coordinator
Jul 6, 2010 at 2:09 PM
Make sure that your App.xaml.cs is calling InitializeComponent() in its constructor.
Coordinator
Jul 6, 2010 at 6:06 PM
Here's the first part: http://caliburnmicro.codeplex.com/wikipage?title=Basic%20Configuration,%20Actions%20and%20Conventions&referringTitle=Documentation
Jul 6, 2010 at 7:08 PM

Hi Rob,

I managed to find out what was the problem in setting up the framework.

I was targeting WPF not Silverlight.  there is a little difference in the code.

The App.xaml should be look like this:

<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Caliburn.Micro.Hello.WPF"
             x:Class="Caliburn.Micro.Hello.WPF.App">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary>
                    <local:HelloBootstrapper x:Key="bootstrapper" />
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

The difference is that we should use MergedDictionaries to setup the Bootstrapper. and we don't need to have any thing in the App.xaml.cs.