コード例 #1
0
        public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType)
        {
            FormsCompatBuilder.AddRenderer(controlType, rendererType);

            handlersCollection.AddHandler(controlType, typeof(RendererToHandlerShim));

            return(handlersCollection);
        }
コード例 #2
0
        public static IMauiHandlersCollection AddCompatibilityRenderer <TControlType, TMauiType, TRenderer>(this IMauiHandlersCollection handlersCollection)
            where TMauiType : IFrameworkElement
        {
            FormsCompatBuilder.AddRenderer(typeof(TControlType), typeof(TRenderer));

            handlersCollection.AddHandler <TMauiType, RendererToHandlerShim>();

            return(handlersCollection);
        }
コード例 #3
0
        public static IMauiHandlersCollection AddCompatibilityRenderer <TControlType, TMauiType, TRenderer>(this IMauiHandlersCollection handlersCollection)
            where TMauiType : IView
        {
            Internals.Registrar.Registered.Register(typeof(TControlType), typeof(TRenderer));

#if __ANDROID__ || __IOS__ || WINDOWS || MACCATALYST
            handlersCollection.AddHandler <TMauiType, RendererToHandlerShim>();
#endif
            return(handlersCollection);
        }
コード例 #4
0
        public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType)
        {
            Internals.Registrar.Registered.Register(controlType, rendererType);

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

            return(handlersCollection);
        }
コード例 #5
0
        public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType)
        {
            // register renderer with old registrar so it can get shimmed
            // This will move to some extension method
            Microsoft.Maui.Controls.Internals.Registrar.Registered.Register(
                controlType,
                rendererType);

            handlersCollection.AddHandler(controlType, typeof(RendererToHandlerShim));

            return(handlersCollection);
        }
コード例 #6
0
        public static IMauiHandlersCollection AddCompatibilityRenderer <TControlType, TMauiType, TRenderer>(this IMauiHandlersCollection handlersCollection)
            where TMauiType : IView
        {
            Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
            Internals.Registrar.Registered.Register(typeof(TControlType), typeof(TRenderer));

#if PLATFORM
#pragma warning disable CS0612 // Type or member is obsolete
            handlersCollection.AddHandler <TMauiType, RendererToHandlerShim>();
#pragma warning restore CS0612 // Type or member is obsolete
#endif
            return(handlersCollection);
        }
コード例 #7
0
        public static IMauiHandlersCollection AddCompatibilityRenderer(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.AddHandler(controlType, typeof(RendererToHandlerShim));
#pragma warning restore CS0612 // Type or member is obsolete
#endif

            return(handlersCollection);
        }
コード例 #8
0
        public static IMauiHandlersCollection AddCompatibilityRenderer <TControlType, TMauiType, TRenderer>(this IMauiHandlersCollection handlersCollection)
            where TMauiType : IFrameworkElement
        {
            // register renderer with old registrar so it can get shimmed
            // This will move to some extension method
            Controls.Internals.Registrar.Registered.Register(
                typeof(TControlType),
                typeof(TRenderer));

            handlersCollection.AddHandler <TMauiType, RendererToHandlerShim>();

            return(handlersCollection);
        }
コード例 #9
0
        public static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlersCollection handlersCollection)
        {
#if __IOS__ || __ANDROID__
            handlersCollection.AddHandler <CollectionView, CollectionViewHandler>();
#endif

#if WINDOWS
            handlersCollection.AddHandler <CollectionView, CollectionViewHandler>();
#endif
#if WINDOWS || __ANDROID__
            handlersCollection.AddHandler <Shell, ShellHandler>();
#endif
            handlersCollection.AddHandler <Application, ApplicationHandler>();
            handlersCollection.AddHandler <ActivityIndicator, ActivityIndicatorHandler>();
            handlersCollection.AddHandler <BoxView, ShapeViewHandler>();
            handlersCollection.AddHandler <Button, ButtonHandler>();
            handlersCollection.AddHandler <CheckBox, CheckBoxHandler>();
            handlersCollection.AddHandler <DatePicker, DatePickerHandler>();
            handlersCollection.AddHandler <Editor, EditorHandler>();
            handlersCollection.AddHandler <Entry, EntryHandler>();
            handlersCollection.AddHandler <GraphicsView, GraphicsViewHandler>();
            handlersCollection.AddHandler <Image, ImageHandler>();
            handlersCollection.AddHandler <Label, LabelHandler>();
            handlersCollection.AddHandler <Layout, LayoutHandler>();
            handlersCollection.AddHandler <Picker, PickerHandler>();
            handlersCollection.AddHandler <ProgressBar, ProgressBarHandler>();
            handlersCollection.AddHandler <ScrollView, ScrollViewHandler>();
            handlersCollection.AddHandler <SearchBar, SearchBarHandler>();
            handlersCollection.AddHandler <Slider, SliderHandler>();
            handlersCollection.AddHandler <Stepper, StepperHandler>();
            handlersCollection.AddHandler <Switch, SwitchHandler>();
            handlersCollection.AddHandler <TimePicker, TimePickerHandler>();
            handlersCollection.AddHandler <Page, PageHandler>();
            handlersCollection.AddHandler <WebView, WebViewHandler>();
            handlersCollection.AddHandler <Border, BorderHandler>();
            handlersCollection.AddHandler <IContentView, ContentViewHandler>();
            handlersCollection.AddHandler <Shapes.Ellipse, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.Line, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.Path, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.Polygon, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.Polyline, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.Rectangle, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.RoundRectangle, ShapeViewHandler>();
            handlersCollection.AddHandler <Window, WindowHandler>();
            handlersCollection.AddHandler <ImageButton, ImageButtonHandler>();
            handlersCollection.AddHandler <IndicatorView, IndicatorViewHandler>();
            handlersCollection.AddHandler <RadioButton, RadioButtonHandler>();
#if __ANDROID__ || __IOS__
            handlersCollection.AddHandler <RefreshView, RefreshViewHandler>();
#endif
#if WINDOWS || ANDROID
            handlersCollection.AddHandler <NavigationPage, NavigationViewHandler>();
            handlersCollection.AddHandler <Toolbar, ToolbarHandler>();
            handlersCollection.AddHandler <FlyoutPage, FlyoutViewHandler>();
#endif
#if ANDROID
            handlersCollection.AddHandler <TabbedPage, Controls.Handlers.TabbedPageHandler>();
            handlersCollection.AddHandler <SwipeView, SwipeViewHandler>();
            handlersCollection.AddHandler <SwipeItem, SwipeItemMenuItemHandler>();
            handlersCollection.AddHandler <SwipeItemView, SwipeItemViewHandler>();
#endif
            return(handlersCollection);
        }
コード例 #10
0
        public static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlersCollection handlersCollection)
        {
            handlersCollection.AddHandler <CollectionView, CollectionViewHandler>();
            handlersCollection.AddHandler <CarouselView, CarouselViewHandler>();
            handlersCollection.AddHandler <Application, ApplicationHandler>();
            handlersCollection.AddHandler <ActivityIndicator, ActivityIndicatorHandler>();
            handlersCollection.AddHandler <BoxView, ShapeViewHandler>();
            handlersCollection.AddHandler <Button, ButtonHandler>();
            handlersCollection.AddHandler <CheckBox, CheckBoxHandler>();
            handlersCollection.AddHandler <DatePicker, DatePickerHandler>();
            handlersCollection.AddHandler <Editor, EditorHandler>();
            handlersCollection.AddHandler <Entry, EntryHandler>();
            handlersCollection.AddHandler <GraphicsView, GraphicsViewHandler>();
            handlersCollection.AddHandler <Image, ImageHandler>();
            handlersCollection.AddHandler <Label, LabelHandler>();
            handlersCollection.AddHandler <Layout, LayoutHandler>();
            handlersCollection.AddHandler <Picker, PickerHandler>();
            handlersCollection.AddHandler <ProgressBar, ProgressBarHandler>();
            handlersCollection.AddHandler <ScrollView, ScrollViewHandler>();
            handlersCollection.AddHandler <SearchBar, SearchBarHandler>();
            handlersCollection.AddHandler <Slider, SliderHandler>();
            handlersCollection.AddHandler <Stepper, StepperHandler>();
            handlersCollection.AddHandler <Switch, SwitchHandler>();
            handlersCollection.AddHandler <TimePicker, TimePickerHandler>();
            handlersCollection.AddHandler <Page, PageHandler>();
            handlersCollection.AddHandler <WebView, WebViewHandler>();
            handlersCollection.AddHandler <Border, BorderHandler>();
            handlersCollection.AddHandler <IContentView, ContentViewHandler>();
            handlersCollection.AddHandler <Shapes.Ellipse, ShapeViewHandler>();
            handlersCollection.AddHandler <Shapes.Line, LineHandler>();
            handlersCollection.AddHandler <Shapes.Path, PathHandler>();
            handlersCollection.AddHandler <Shapes.Polygon, PolygonHandler>();
            handlersCollection.AddHandler <Shapes.Polyline, PolylineHandler>();
            handlersCollection.AddHandler <Shapes.Rectangle, RectangleHandler>();
            handlersCollection.AddHandler <Shapes.RoundRectangle, RoundRectangleHandler>();
            handlersCollection.AddHandler <Window, WindowHandler>();
            handlersCollection.AddHandler <ImageButton, ImageButtonHandler>();
            handlersCollection.AddHandler <IndicatorView, IndicatorViewHandler>();
            handlersCollection.AddHandler <RadioButton, RadioButtonHandler>();
            handlersCollection.AddHandler <RefreshView, RefreshViewHandler>();
            handlersCollection.AddHandler <SwipeItem, SwipeItemMenuItemHandler>();
            handlersCollection.AddHandler <SwipeView, SwipeViewHandler>();

            handlersCollection.AddHandler <MenuBar, MenuBarHandler>();
            handlersCollection.AddHandler <MenuFlyoutSubItem, MenuFlyoutSubItemHandler>();
            handlersCollection.AddHandler <MenuFlyoutItem, MenuFlyoutItemHandler>();
            handlersCollection.AddHandler <MenuBarItem, MenuBarItemHandler>();

#if WINDOWS || ANDROID || IOS || MACCATALYST
            handlersCollection.AddHandler(typeof(ListView), typeof(Handlers.Compatibility.ListViewRenderer));
            handlersCollection.AddHandler(typeof(Cell), typeof(Handlers.Compatibility.CellRenderer));
            handlersCollection.AddHandler(typeof(ImageCell), typeof(Handlers.Compatibility.ImageCellRenderer));
            handlersCollection.AddHandler(typeof(EntryCell), typeof(Handlers.Compatibility.EntryCellRenderer));
            handlersCollection.AddHandler(typeof(TextCell), typeof(Handlers.Compatibility.TextCellRenderer));
            handlersCollection.AddHandler(typeof(ViewCell), typeof(Handlers.Compatibility.ViewCellRenderer));
            handlersCollection.AddHandler(typeof(SwitchCell), typeof(Handlers.Compatibility.SwitchCellRenderer));
            handlersCollection.AddHandler(typeof(TableView), typeof(Handlers.Compatibility.TableViewRenderer));
            handlersCollection.AddHandler(typeof(Frame), typeof(Handlers.Compatibility.FrameRenderer));
#endif

#if IOS || MACCATALYST
            handlersCollection.AddHandler(typeof(NavigationPage), typeof(Handlers.Compatibility.NavigationRenderer));
            handlersCollection.AddHandler(typeof(TabbedPage), typeof(Handlers.Compatibility.TabbedRenderer));
            handlersCollection.AddHandler(typeof(FlyoutPage), typeof(Handlers.Compatibility.PhoneFlyoutPageRenderer));
#endif

#if ANDROID || IOS || MACCATALYST || TIZEN
            handlersCollection.AddHandler <SwipeItemView, SwipeItemViewHandler>();
#if ANDROID || IOS || MACCATALYST
            handlersCollection.AddHandler <Shell, ShellRenderer>();
#else
            handlersCollection.AddHandler <Shell, ShellHandler>();
#endif
#endif
#if WINDOWS || ANDROID
            handlersCollection.AddHandler <NavigationPage, NavigationViewHandler>();
            handlersCollection.AddHandler <Toolbar, ToolbarHandler>();
            handlersCollection.AddHandler <FlyoutPage, FlyoutViewHandler>();
            handlersCollection.AddHandler <TabbedPage, TabbedViewHandler>();
#endif

#if WINDOWS
            handlersCollection.AddHandler <ShellItem, ShellItemHandler>();
            handlersCollection.AddHandler <ShellSection, ShellSectionHandler>();
            handlersCollection.AddHandler <ShellContent, ShellContentHandler>();
            handlersCollection.AddHandler <Shell, ShellHandler>();
#endif
            return(handlersCollection);
        }