From 6f678449705dd86d23554e16c95d9b2383e8df23 Mon Sep 17 00:00:00 2001 From: Antony Male Date: Sun, 14 Feb 2021 11:22:28 +0000 Subject: [PATCH] Bootstrappers: Make RootViewModel strongly typed --- Bootstrappers/AutofacBootstrapper.cs | 6 +++--- Bootstrappers/CastleWindsorBootstrapper.cs | 6 +++--- Bootstrappers/MicrosoftDependencyInjectionBootstrapper.cs | 6 +++--- Bootstrappers/NinjectBootstrapper.cs | 6 +++--- Bootstrappers/StructureMapBootstrapper.cs | 6 +++--- Bootstrappers/UnityBootstrapper.cs | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Bootstrappers/AutofacBootstrapper.cs b/Bootstrappers/AutofacBootstrapper.cs index f3c20d8..ba54b74 100644 --- a/Bootstrappers/AutofacBootstrapper.cs +++ b/Bootstrappers/AutofacBootstrapper.cs @@ -12,10 +12,10 @@ namespace Bootstrappers { private IContainer container; - private object _rootViewModel; - protected virtual object RootViewModel + private TRootViewModel _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() diff --git a/Bootstrappers/CastleWindsorBootstrapper.cs b/Bootstrappers/CastleWindsorBootstrapper.cs index b571d2a..c9940ff 100644 --- a/Bootstrappers/CastleWindsorBootstrapper.cs +++ b/Bootstrappers/CastleWindsorBootstrapper.cs @@ -14,10 +14,10 @@ namespace Bootstrappers { private IWindsorContainer container; - private object _rootViewModel; - protected virtual object RootViewModel + private TRootViewModel _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() diff --git a/Bootstrappers/MicrosoftDependencyInjectionBootstrapper.cs b/Bootstrappers/MicrosoftDependencyInjectionBootstrapper.cs index 1fa3e46..43caaf1 100644 --- a/Bootstrappers/MicrosoftDependencyInjectionBootstrapper.cs +++ b/Bootstrappers/MicrosoftDependencyInjectionBootstrapper.cs @@ -11,10 +11,10 @@ namespace Bootstrappers { private ServiceProvider serviceProvider; - private object _rootViewModel; - protected virtual object RootViewModel + private TRootViewModel _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 diff --git a/Bootstrappers/NinjectBootstrapper.cs b/Bootstrappers/NinjectBootstrapper.cs index 092bc54..cfce839 100644 --- a/Bootstrappers/NinjectBootstrapper.cs +++ b/Bootstrappers/NinjectBootstrapper.cs @@ -11,10 +11,10 @@ namespace Bootstrappers { private IKernel kernel; - private object _rootViewModel; - protected virtual object RootViewModel + private TRootViewModel _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() diff --git a/Bootstrappers/StructureMapBootstrapper.cs b/Bootstrappers/StructureMapBootstrapper.cs index 9845ae9..5d0233c 100644 --- a/Bootstrappers/StructureMapBootstrapper.cs +++ b/Bootstrappers/StructureMapBootstrapper.cs @@ -12,10 +12,10 @@ namespace Bootstrappers { private IContainer container; - private object _rootViewModel; - protected virtual object RootViewModel + private TRootViewModel _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() diff --git a/Bootstrappers/UnityBootstrapper.cs b/Bootstrappers/UnityBootstrapper.cs index f204055..77ccf4d 100644 --- a/Bootstrappers/UnityBootstrapper.cs +++ b/Bootstrappers/UnityBootstrapper.cs @@ -11,10 +11,10 @@ namespace Bootstrappers { private IUnityContainer container; - private object _rootViewModel; - protected virtual object RootViewModel + private TRootViewModel _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()