Bootstrappers: Make RootViewModel strongly typed

This commit is contained in:
Antony Male 2021-02-14 11:22:28 +00:00
parent acf78533eb
commit 6f67844970
6 changed files with 18 additions and 18 deletions

View File

@ -12,10 +12,10 @@ namespace Bootstrappers
{ {
private IContainer container; private IContainer container;
private object _rootViewModel; private TRootViewModel _rootViewModel;
protected virtual object RootViewModel protected virtual TRootViewModel RootViewModel
{ {
get { return this._rootViewModel ?? (this._rootViewModel = this.GetInstance(typeof(TRootViewModel))); } get { return this._rootViewModel ?? (this._rootViewModel = (TRootViewModel)this.GetInstance(typeof(TRootViewModel))); }
} }
protected override void ConfigureBootstrapper() protected override void ConfigureBootstrapper()

View File

@ -14,10 +14,10 @@ namespace Bootstrappers
{ {
private IWindsorContainer container; private IWindsorContainer container;
private object _rootViewModel; private TRootViewModel _rootViewModel;
protected virtual object RootViewModel protected virtual TRootViewModel RootViewModel
{ {
get { return this._rootViewModel ?? (this._rootViewModel = this.GetInstance(typeof(TRootViewModel))); } get { return this._rootViewModel ?? (this._rootViewModel = (TRootViewModel)this.GetInstance(typeof(TRootViewModel))); }
} }
protected override void ConfigureBootstrapper() protected override void ConfigureBootstrapper()

View File

@ -11,10 +11,10 @@ namespace Bootstrappers
{ {
private ServiceProvider serviceProvider; private ServiceProvider serviceProvider;
private object _rootViewModel; private TRootViewModel _rootViewModel;
protected virtual object RootViewModel protected virtual TRootViewModel RootViewModel
{ {
get { return this._rootViewModel ?? (this._rootViewModel = this.GetInstance(typeof(TRootViewModel))); } get { return this._rootViewModel ?? (this._rootViewModel = (TRootViewModel)this.GetInstance(typeof(TRootViewModel))); }
} }
public IServiceProvider ServiceProvider public IServiceProvider ServiceProvider

View File

@ -11,10 +11,10 @@ namespace Bootstrappers
{ {
private IKernel kernel; private IKernel kernel;
private object _rootViewModel; private TRootViewModel _rootViewModel;
protected virtual object RootViewModel protected virtual TRootViewModel RootViewModel
{ {
get { return this._rootViewModel ?? (this._rootViewModel = this.GetInstance(typeof(TRootViewModel))); } get { return this._rootViewModel ?? (this._rootViewModel = (TRootViewModel)this.GetInstance(typeof(TRootViewModel))); }
} }
protected override void ConfigureBootstrapper() protected override void ConfigureBootstrapper()

View File

@ -12,10 +12,10 @@ namespace Bootstrappers
{ {
private IContainer container; private IContainer container;
private object _rootViewModel; private TRootViewModel _rootViewModel;
protected virtual object RootViewModel protected virtual TRootViewModel RootViewModel
{ {
get { return this._rootViewModel ?? (this._rootViewModel = this.GetInstance(typeof(TRootViewModel))); } get { return this._rootViewModel ?? (this._rootViewModel = (TRootViewModel)this.GetInstance(typeof(TRootViewModel))); }
} }
protected override void ConfigureBootstrapper() protected override void ConfigureBootstrapper()

View File

@ -11,10 +11,10 @@ namespace Bootstrappers
{ {
private IUnityContainer container; private IUnityContainer container;
private object _rootViewModel; private TRootViewModel _rootViewModel;
protected virtual object RootViewModel protected virtual TRootViewModel RootViewModel
{ {
get { return this._rootViewModel ?? (this._rootViewModel = this.GetInstance(typeof(TRootViewModel))); } get { return this._rootViewModel ?? (this._rootViewModel = (TRootViewModel)this.GetInstance(typeof(TRootViewModel))); }
} }
protected override void ConfigureBootstrapper() protected override void ConfigureBootstrapper()