summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrakeWPF/Services/MefBootstrapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/HandBrakeWPF/Services/MefBootstrapper.cs')
-rw-r--r--win/C#/HandBrakeWPF/Services/MefBootstrapper.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/win/C#/HandBrakeWPF/Services/MefBootstrapper.cs b/win/C#/HandBrakeWPF/Services/MefBootstrapper.cs
new file mode 100644
index 000000000..bd05356c0
--- /dev/null
+++ b/win/C#/HandBrakeWPF/Services/MefBootstrapper.cs
@@ -0,0 +1,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);
+ }
+ }
+} \ No newline at end of file