Added Autofac
This commit is contained in:
25
MaterialModernWPF/Bootstrapper.cs
Normal file
25
MaterialModernWPF/Bootstrapper.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user