summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrakeWPF/Services/MefBootstrapper.cs
blob: bd05356c0194e69822965033607f571f7670485a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
namespace HandBrakeWPF.Services 
{
    using System.ComponentModel.Composition.Hosting;
    using System.Linq;

    using Caliburn.Core.InversionOfControl;
    using Caliburn.MEF;
    using Caliburn.PresentationFramework.ApplicationModel;

    using HandBrakeWPF.ViewModels.Interfaces;

    public class MefBootstrapper : Bootstrapper<IMainViewModel> 
    {
        protected override IServiceLocator CreateContainer() 
        {
            var container = new CompositionContainer(new AggregateCatalog(SelectAssemblies().Select(x => new AssemblyCatalog(x))));

            return new MEFAdapter(container);
        }
    }
}