Added Autofac

This commit is contained in:
Holger Boerchers
2016-07-25 21:37:43 +02:00
parent 12b3d0c7fb
commit d7919fbe79
7 changed files with 75 additions and 34 deletions

View File

@@ -0,0 +1,25 @@
using System.Windows;
using Autofac;
using Prism.Autofac;
namespace MaterialModernWPF
{
public class Bootstrapper : AutofacBootstrapper
{
protected override void ConfigureContainerBuilder(ContainerBuilder builder)
{
base.ConfigureContainerBuilder(builder);
builder.RegisterType<Shell>();
//builder.RegisterType<Plugin1.ClassInit>();
}
protected override DependencyObject CreateShell() => Container.Resolve<Shell>();
protected override void InitializeShell()
{
base.InitializeShell();
Application.Current.MainWindow = (Window)Shell;
Application.Current.MainWindow.Show();
}
}
}