Sigh... Never mind... I went back and actually read the whole part 2 :-) Now the HelloWPF app is working fine with MEF. For those who are interested here is the relevant part of the MefBoostrapper for WPF4
class MefBootstrapper : Caliburn.Micro.Bootstrapper<IShell>
private CompositionContainer container;
protected override void Configure()
container = new CompositionContainer(new AggregateCatalog(
AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()
Rest of the code is the same.
BTW, you still have to create an marker IShell interface and do the following changes to the ShellViewModel class
public class ShellViewModel : PropertyChangedBase, IShell
I kind of miss the conventions based approach of wiring ShellViewModel to ShellView as described in part 1. In the MEF based approach it looks like these need to be done via code. I was planning to use MEF for the ability to do plugins.
Maybe I shouldn't use MEF as the IOC in Caliburn.Micro and use MEF separately to detect plugins. I hope the question makes sense...