diff --git a/src/Forms/Prism.Forms/PrismApplicationBase.cs b/src/Forms/Prism.Forms/PrismApplicationBase.cs index 3af9466821..b17b8d71c6 100644 --- a/src/Forms/Prism.Forms/PrismApplicationBase.cs +++ b/src/Forms/Prism.Forms/PrismApplicationBase.cs @@ -102,7 +102,7 @@ protected virtual void ConfigureViewModelLocator() { ViewModelLocationProvider.SetDefaultViewModelFactory((view, type) => { - List<(Type Type, object Instance)> overrides = new List<(Type, object)>(); + List<(Type Type, object Instance)> overrides = []; if (Container.IsRegistered()) { var resolver = Container.Resolve(); @@ -148,8 +148,6 @@ protected virtual void Initialize() PlatformInitializer?.RegisterTypes(_containerExtension); RegisterTypes(_containerExtension); - _containerExtension.FinalizeExtension(); - _moduleCatalog = Container.Resolve(); ConfigureModuleCatalog(_moduleCatalog); } diff --git a/src/Maui/Prism.Maui/PrismAppBuilder.cs b/src/Maui/Prism.Maui/PrismAppBuilder.cs index 7a2143e6d8..ccf6eab6f6 100644 --- a/src/Maui/Prism.Maui/PrismAppBuilder.cs +++ b/src/Maui/Prism.Maui/PrismAppBuilder.cs @@ -27,12 +27,12 @@ public sealed class PrismAppBuilder internal PrismAppBuilder(IContainerExtension containerExtension, MauiAppBuilder builder) { - if (containerExtension is null) - throw new ArgumentNullException(nameof(containerExtension)); + ArgumentNullException.ThrowIfNull(containerExtension); + ArgumentNullException.ThrowIfNull(builder); _container = containerExtension; - _registrations = new List>(); - _initializations = new List>(); + _registrations = []; + _initializations = []; ViewModelCreationException.SetViewNameDelegate(view => { @@ -89,7 +89,7 @@ internal PrismAppBuilder(IContainerExtension containerExtension, MauiAppBuilder /// public MauiAppBuilder MauiBuilder { get; } - private void ConfigureViewModelLocator() + private static void ConfigureViewModelLocator() { ViewModelLocationProvider.SetDefaultViewToViewModelTypeResolver(view => { diff --git a/src/Uno/Prism.Uno/PrismApplicationBase.cs b/src/Uno/Prism.Uno/PrismApplicationBase.cs old mode 100755 new mode 100644 index 71dba9e1a7..74b2e47eef --- a/src/Uno/Prism.Uno/PrismApplicationBase.cs +++ b/src/Uno/Prism.Uno/PrismApplicationBase.cs @@ -126,7 +126,6 @@ protected virtual void Initialize(IApplicationBuilder builder) _containerExtension.RegisterInstance(builder.Window); RegisterRequiredTypes(_containerExtension); RegisterTypes(_containerExtension); - _containerExtension.FinalizeExtension(); ConfigureModuleCatalog(Container.Resolve()); diff --git a/src/Wpf/Prism.Wpf/PrismApplicationBase.cs b/src/Wpf/Prism.Wpf/PrismApplicationBase.cs index ce6a615f24..86954c2772 100644 --- a/src/Wpf/Prism.Wpf/PrismApplicationBase.cs +++ b/src/Wpf/Prism.Wpf/PrismApplicationBase.cs @@ -61,7 +61,6 @@ protected virtual void Initialize() _moduleCatalog = CreateModuleCatalog(); RegisterRequiredTypes(_containerExtension); RegisterTypes(_containerExtension); - _containerExtension.FinalizeExtension(); ConfigureModuleCatalog(_moduleCatalog); diff --git a/src/Wpf/Prism.Wpf/PrismBootstrapperBase.cs b/src/Wpf/Prism.Wpf/PrismBootstrapperBase.cs index e1d9cc386d..5cb14eaef0 100644 --- a/src/Wpf/Prism.Wpf/PrismBootstrapperBase.cs +++ b/src/Wpf/Prism.Wpf/PrismBootstrapperBase.cs @@ -58,7 +58,6 @@ protected virtual void Initialize() _moduleCatalog = CreateModuleCatalog(); RegisterRequiredTypes(_containerExtension); RegisterTypes(_containerExtension); - _containerExtension.FinalizeExtension(); ConfigureModuleCatalog(_moduleCatalog);