diff --git a/eng/BannedSymbols.txt b/eng/BannedSymbols.txt index 58c061812120..4c25dda60acb 100644 --- a/eng/BannedSymbols.txt +++ b/eng/BannedSymbols.txt @@ -1,21 +1,15 @@ M:Android.Content.Res.ColorStateList.#ctor(System.Int32[][],System.Int32[]);Use Microsoft.Maui.PlatformInterop.Get*ColorStateList() Java methods instead M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddScoped(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Type,System.Type);Use a Factory method to register the service instead -M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddScoped`1(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddScoped`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Type,System.Type);Use a Factory method to register the service instead -M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton`1(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddTransient(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Type,System.Type);Use a Factory method to register the service instead -M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddTransient`1(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddTransient`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddScoped(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Type,System.Type);Use a Factory method to register the service instead -M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddScoped`1(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddScoped`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Type,System.Type);Use a Factory method to register the service instead -M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton`1(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddTransient(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Type,System.Type);Use a Factory method to register the service instead -M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddTransient`1(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddTransient`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to register the service instead M:Microsoft.Maui.Hosting.ImageSourceServiceCollectionExtensions.AddService`2(Microsoft.Maui.Hosting.IImageSourceServiceCollection);Use a Factory method to register the service instead M:Microsoft.Maui.Hosting.MauiHandlersCollectionExtensions.AddHandler(Microsoft.Maui.Hosting.IMauiHandlersCollection,System.Type,System.Type);Use a Factory method to register the service instead diff --git a/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs b/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs index b7b0c748177d..25dfac32b907 100644 --- a/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs +++ b/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs @@ -42,14 +42,14 @@ public static IMauiBlazorWebViewBuilder AddMauiBlazorWebView(this IServiceCollec services.AddBlazorWebView(); services.TryAddSingleton(new BlazorWebViewDeveloperTools { Enabled = false }); #if WEBVIEW2_MAUI - services.TryAddSingleton(_ => new MauiBlazorMarkerService()); + services.TryAddSingleton(); services.ConfigureMauiHandlers(static handlers => handlers.AddHandler(_ => new BlazorWebViewHandler())); return new MauiBlazorWebViewBuilder(services); #elif WEBVIEW2_WINFORMS - services.TryAddSingleton(_ => new WindowsFormsBlazorMarkerService()); + services.TryAddSingleton(); return new WindowsFormsBlazorWebViewBuilder(services); #elif WEBVIEW2_WPF - services.TryAddSingleton(_ => new WpfBlazorMarkerService()); + services.TryAddSingleton(); return new WpfBlazorWebViewBuilder(services); #endif } diff --git a/src/Controls/src/Core/Hosting/Effects/AppHostBuilderExtensions.cs b/src/Controls/src/Core/Hosting/Effects/AppHostBuilderExtensions.cs index b07d070b0054..75b6b3aaacfb 100644 --- a/src/Controls/src/Core/Hosting/Effects/AppHostBuilderExtensions.cs +++ b/src/Controls/src/Core/Hosting/Effects/AppHostBuilderExtensions.cs @@ -42,7 +42,7 @@ public static partial class AppHostBuilderExtensions { public static MauiAppBuilder ConfigureEffects(this MauiAppBuilder builder, Action configureDelegate) { - builder.Services.TryAddSingleton(svc => new EffectsFactory(svc.GetServices())); + builder.Services.TryAddSingleton(); if (configureDelegate != null) { builder.Services.AddSingleton(new EffectsRegistration(configureDelegate)); diff --git a/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs b/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs index adaf4540b2bc..4004dc8fd036 100644 --- a/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs +++ b/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs @@ -192,7 +192,7 @@ static MauiAppBuilder SetupDefaults(this MauiAppBuilder builder) DependencyService.Register(); #pragma warning restore CS0612, CA1416 // Type or member is obsolete #endif - builder.Services.AddScoped(_ => new HideSoftInputOnTappedChangedManager()); + builder.Services.AddScoped(); builder.ConfigureImageSourceHandlers(); builder .ConfigureMauiHandlers(handlers =>