Ensure View.ViewManager is set before Configure called

This commit is contained in:
Antony Male 2015-04-05 17:46:17 +01:00
parent 8479672028
commit 9f3a7d665a
8 changed files with 6 additions and 48 deletions

View File

@ -18,19 +18,12 @@ namespace Bootstrappers
protected override void ConfigureBootstrapper()
{
this.Configure();
var builder = new ContainerBuilder();
this.DefaultConfigureIoC(builder);
this.ConfigureIoC(builder);
this.container = builder.Build();
}
/// <summary>
/// Override to configure anything that needs configuring
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Carries out default configuration of the IoC container. Override if you don't want to do this
/// </summary>

View File

@ -19,18 +19,11 @@ namespace Bootstrappers
protected override void ConfigureBootstrapper()
{
this.Configure();
this.container = new WindsorContainer();
this.DefaultConfigureIoC(this.container);
this.ConfigureIoC(this.container);
}
/// <summary>
/// Override to configure anything that needs configuring
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Carries out default configuration of the IoC container. Override if you don't want to do this
/// </summary>

View File

@ -17,18 +17,11 @@ namespace Bootstrappers
protected override void ConfigureBootstrapper()
{
this.Configure();
this.kernel = new StandardKernel();
this.DefaultConfigureIoC(this.kernel);
this.ConfigureIoC(this.kernel);
}
/// <summary>
/// Override to configure anything that needs configuring
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Carries out default configuration of the IoC container. Override if you don't want to do this
/// </summary>

View File

@ -10,16 +10,10 @@ namespace Bootstrappers
protected override void ConfigureBootstrapper()
{
this.Configure();
this.DefaultConfigureContainer();
this.ConfigureContainer();
}
/// <summary>
/// Override to configure anything that needs configuring
/// </summary>
protected virtual void Configure() { }
protected virtual void DefaultConfigureContainer()
{
var viewManager = new ViewManager(this);

View File

@ -18,8 +18,6 @@ namespace Bootstrappers
protected override void ConfigureBootstrapper()
{
this.Configure();
this.container = new Container(config =>
{
this.DefaultConfigureIoC(config);
@ -27,11 +25,6 @@ namespace Bootstrappers
});
}
/// <summary>
/// Override to configure anything that needs configuring
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Carries out default configuration of the IoC container. Override if you don't want to do this
/// </summary>

View File

@ -17,18 +17,11 @@ namespace Bootstrappers
protected override void ConfigureBootstrapper()
{
this.Configure();
this.container = new UnityContainer();
this.DefaultConfigureIoC(this.container);
this.ConfigureIoC(this.container);
}
/// <summary>
/// Override to configure anything that needs configuring
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Carries out default configuration of the IoC container. Override if you don't want to do this
/// </summary>

View File

@ -40,15 +40,8 @@ namespace Stylet
this.DefaultConfigureIoC(builder);
this.Container = builder.BuildContainer();
this.Configure();
}
/// <summary>
/// Hook called after the IoC container has been set up
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Carries out default configuration of StyletIoC. Override if you don't want to do this
/// </summary>

View File

@ -87,10 +87,16 @@ namespace Stylet
View.ViewManager = (IViewManager)this.GetInstance(typeof(IViewManager));
this.Configure();
this.Launch();
this.OnLaunch();
}
/// <summary>
/// Hook called after the IoC container has been set up
/// </summary>
protected virtual void Configure() { }
/// <summary>
/// Launch the root view
/// </summary>