public static IMauiHandlersCollection TryAddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType)
        {
            Internals.Registrar.Registered.Register(controlType, rendererType);

#if __ANDROID__ || __IOS__ || WINDOWS || MACCATALYST
            handlersCollection.TryAddHandler(controlType, typeof(RendererToHandlerShim));
#endif

            return(handlersCollection);
        }
Exemple #2
0
        public static IMauiHandlersCollection TryAddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType)
        {
            Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
            Internals.Registrar.Registered.Register(controlType, rendererType);

#if PLATFORM
#pragma warning disable CS0612 // Type or member is obsolete
            handlersCollection.TryAddHandler(controlType, typeof(RendererToHandlerShim));
#pragma warning restore CS0612 // Type or member is obsolete
#endif

            return(handlersCollection);
        }
        public static IMauiHandlersCollection AddCompatibilityRenderers(this IMauiHandlersCollection handlersCollection, params global::System.Reflection.Assembly[] assemblies)
        {
#if __ANDROID__ || __IOS__ || WINDOWS || MACCATALYST
            Internals.Registrar.RegisterAll(
                assemblies,
                null,
                new[]
            {
                typeof(ExportRendererAttribute),
                typeof(ExportCellAttribute),
            }, default(InitializationFlags),
                (result) =>
            {
                handlersCollection?.TryAddHandler(result.target, typeof(RendererToHandlerShim));
            });
#endif


            return(handlersCollection);
        }
Exemple #4
0
        public static IMauiHandlersCollection AddCompatibilityRenderers(this IMauiHandlersCollection handlersCollection, params global::System.Reflection.Assembly[] assemblies)
        {
            Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
#if PLATFORM
            Internals.Registrar.RegisterAll(
                assemblies,
                null,
                new[]
            {
                typeof(ExportRendererAttribute),
                typeof(ExportCellAttribute),
            }, default(InitializationFlags),
                (result) =>
            {
#pragma warning disable CS0612 // Type or member is obsolete
                handlersCollection?.TryAddHandler(result.target, typeof(RendererToHandlerShim));
#pragma warning restore CS0612 // Type or member is obsolete
            });
#endif


            return(handlersCollection);
        }