diff --git a/eng/BannedSymbols.txt b/eng/BannedSymbols.txt index 346bb7356dba..4c25dda60acb 100644 --- a/eng/BannedSymbols.txt +++ b/eng/BannedSymbols.txt @@ -1,2 +1,18 @@ -M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to create the service instead 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`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`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`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`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`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`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 +M:Microsoft.Maui.Hosting.MauiHandlersCollectionExtensions.AddHandler`2(Microsoft.Maui.Hosting.IMauiHandlersCollection);Use a Factory method to register the service instead +M:Microsoft.Maui.Hosting.MauiHandlersCollectionExtensions.TryAddHandler(Microsoft.Maui.Hosting.IMauiHandlersCollection,System.Type,System.Type);Use a Factory method to register the service instead +M:Microsoft.Maui.Hosting.MauiHandlersCollectionExtensions.TryAddHandler`2(Microsoft.Maui.Hosting.IMauiHandlersCollection);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 20150d38c056..25dfac32b907 100644 --- a/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs +++ b/src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs @@ -43,7 +43,7 @@ public static IMauiBlazorWebViewBuilder AddMauiBlazorWebView(this IServiceCollec services.TryAddSingleton(new BlazorWebViewDeveloperTools { Enabled = false }); #if WEBVIEW2_MAUI services.TryAddSingleton(); - services.ConfigureMauiHandlers(static handlers => handlers.AddHandler()); + services.ConfigureMauiHandlers(static handlers => handlers.AddHandler(_ => new BlazorWebViewHandler())); return new MauiBlazorWebViewBuilder(services); #elif WEBVIEW2_WINFORMS services.TryAddSingleton(); diff --git a/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs b/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs index df004cad2fc7..7d049eff5cb0 100644 --- a/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs +++ b/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs @@ -13,9 +13,9 @@ public static IMauiHandlersCollection TryAddCompatibilityRenderer(this IMauiHand Internals.Registrar.Registered.Register(controlType, rendererType); #if PLATFORM -#pragma warning disable CS0612 // Type or member is obsolete +#pragma warning disable CS0612, RS0030 // Type or member is obsolete handlersCollection.TryAddHandler(controlType, typeof(RendererToHandlerShim)); -#pragma warning restore CS0612 // Type or member is obsolete +#pragma warning restore CS0612, RS0030 // Type or member is obsolete #endif return handlersCollection; @@ -28,9 +28,9 @@ public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandler Internals.Registrar.Registered.Register(controlType, rendererType); #if PLATFORM -#pragma warning disable CS0612 // Type or member is obsolete +#pragma warning disable CS0612, RS0030 // Type or member is obsolete handlersCollection.AddHandler(controlType, typeof(RendererToHandlerShim)); -#pragma warning restore CS0612 // Type or member is obsolete +#pragma warning restore CS0612, RS0030 // Type or member is obsolete #endif return handlersCollection; @@ -44,9 +44,9 @@ public static IMauiHandlersCollection AddCompatibilityRenderer(); -#pragma warning restore CS0612 // Type or member is obsolete +#pragma warning restore CS0612, RS0030 // Type or member is obsolete #endif return handlersCollection; } @@ -76,9 +76,9 @@ public static IMauiHandlersCollection AddCompatibilityRenderers(this IMauiHandle }, default(InitializationFlags), (result) => { -#pragma warning disable CS0612 // Type or member is obsolete +#pragma warning disable CS0612, RS0030 // Type or member is obsolete handlersCollection?.TryAddHandler(result.target, typeof(RendererToHandlerShim)); -#pragma warning restore CS0612 // Type or member is obsolete +#pragma warning restore CS0612, RS0030 // Type or member is obsolete }); #endif diff --git a/src/Controls/Maps/src/AppHostBuilderExtensions.cs b/src/Controls/Maps/src/AppHostBuilderExtensions.cs index 49c832891829..c4d374be84bf 100644 --- a/src/Controls/Maps/src/AppHostBuilderExtensions.cs +++ b/src/Controls/Maps/src/AppHostBuilderExtensions.cs @@ -59,9 +59,9 @@ public static MauiAppBuilder UseMauiMaps(this MauiAppBuilder builder) public static IMauiHandlersCollection AddMauiMaps(this IMauiHandlersCollection handlersCollection) { #if __ANDROID__ || __IOS__ - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); + handlersCollection.AddHandler(_ => new MapHandler()); + handlersCollection.AddHandler(_ => new MapPinHandler()); + handlersCollection.AddHandler(_ => new MapElementHandler()); #endif return handlersCollection; } diff --git a/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs b/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs index 2ffeafc4ab82..37ad6aa098d3 100644 --- a/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs +++ b/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs @@ -62,101 +62,112 @@ public static partial class AppHostBuilderExtensions public static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlersCollection handlersCollection) { - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); - handlersCollection.AddHandler(); + handlersCollection.AddHandler(_ => new CollectionViewHandler()); + handlersCollection.AddHandler(_ => new CarouselViewHandler()); + handlersCollection.AddHandler(_ => new ApplicationHandler()); + handlersCollection.AddHandler(_ => new ActivityIndicatorHandler()); + handlersCollection.AddHandler(_ => new BoxViewHandler()); + handlersCollection.AddHandler