All About Actions Tutorial

Topics: Actions & Coroutines, Bugs, Getting Started
Jan 18, 2012 at 10:43 PM
Edited Jan 18, 2012 at 10:55 PM

Caliburn Micro is definetly fast to learn, provided one is familiar with MVVM concepts.

I had an issue with biding in one of the tutorials . I could not get the AllAbout Actions Tutorial to work completly , or only using conventions.

However as Soon as I include this line in the user control of the ShellIView.xaml


The application generates an exception, stops running or does not respond to the buttons or both.

"Could not locate any instances of contract Shell"  from 


override object GetInstance(Type serviceType, string key) of Bootstrapper.


 Furthermore the method protected override void DisplayRootView() will not compile because

Error 1 'CaliburnMicroApplication2.MefBootstrapper.DisplayRootView()': no suitable method found to override ...

using the Bootstrapper as per the tutorial..

I commented the DisplayRootView override methiod out and use both attributes above ShelllViewModel:


Export("Shell", typeof(IShell ))]  

[Export(typeof(IShell ))]  

 public class ShellViewModel : PropertyChangedBase, IShell ..

Perhaps somebody can explain, but I think it is possibly my lack of Mef knowledge..

Maybe this will help some others doing that tutorial. Posted it under the tutorial ..

Perhaps there is another way to get it right but I tried all permutations and this finally worked.

Jan 19, 2012 at 4:10 AM

I think you may be mixing the ViewModel-First and the View-First approaches. I'm not sure based on your explanation. Also, I think that the docs may have gotten slightly out of date with the latest release because DisplayRootView no longer exists. The equivalent action is to override OnStartup. Sorry about that.

Jan 19, 2012 at 4:13 AM

I've fixed up the docs.

Jan 20, 2012 at 12:36 PM

Hi I am afraid I am confusing something, perhaps somebody can help.

I also tried the bubble action sample and as soon as I put in the cal:Bind.Model = Shell into the Usercontrol of shellview.xaml the project crashes upon running it with the same exception. 


UserControl x:Class ="Caliburn.Micro.BubblingAction.ShellView"


xmlns =

 xmlns:x =""


xmlns:cal ="" 


cal:Bind.Model ="Shell">


Putting both attributes on top of shellviewmodel, fixed it, but am not sure that is the right way:





Export("Shell", typeof(IShell))]




public class ShellViewModel : IShell


Perhaps I am doing something else wrong. I can get it to work perfectly by just using the binding by convention.

Jan 20, 2012 at 2:53 PM

Why are you putting Bind.Model="Shell" ? Did you download the samples and try them out? I think you are mixing two different techniques.

Jan 20, 2012 at 5:11 PM
Edited Jan 20, 2012 at 5:14 PM


after "Finally, we will alter our view to pull in the VM and perform all bindings:"

"<UserControl x:Class="Caliburn.Micro.ViewFirst.ShellView"
        <TextBox x:Name="Name" />
        <Button x:Name="SayHello"
                Content="Click Me" />
</UserControl> "

"Notice the use of the Bind.Model attached property. This resolves our VM by key from the IoC container, sets the Action.Target and DataContext and applies all conventions."

 My understanding is that this is view first design.?