Exemplo n.º 1
0
        public static void Init()
        {
            if (_hasInitialized)
            {
                return;
            }
            _hasInitialized = true;

            // Controls
            Registrar.Handlers.Register <ActivityIndicator, ActivityIndicatorHandler>();
            Registrar.Handlers.Register <Button, ButtonHandler>();
            Registrar.Handlers.Register <Image, ImageHandler>();
            Registrar.Handlers.Register <ProgressBar, ProgressBarHandler>();
            Registrar.Handlers.Register <SecureField, SecureFieldHandler>();
            Registrar.Handlers.Register <ShapeView, ShapeViewHandler>();
            Registrar.Handlers.Register <Slider, SliderHandler>();
            Registrar.Handlers.Register <Stepper, StepperHandler>();
            Registrar.Handlers.Register <DatePicker, DatePickerHandler>();
            Registrar.Handlers.Register <Text, TextHandler>();
            Registrar.Handlers.Register <TextField, TextFieldHandler>();
            Registrar.Handlers.Register <Toggle, ToggleHandler>();
            Registrar.Handlers.Register <RadioButton, RadioButtonHandler>();
            //Registrar.Handlers.Register<WebView, WebViewHandler> ();

            // Containers
            Registrar.Handlers.Register <ContentView, ContentViewHandler>();
            Registrar.Handlers.Register <ListView, ListViewHandler>();
            Registrar.Handlers.Register <ScrollView, ScrollViewHandler>();
            Registrar.Handlers.Register <View, ViewHandler>();
            Registrar.Handlers.Register <ViewRepresentable, ViewRepresentableHandler>();
            Registrar.Handlers.Register <TabView, TabViewHandler>();

            // Managed Layout
            Registrar.Handlers.Register <HStack, HStackHandler>();
            Registrar.Handlers.Register <VStack, VStackHandler>();
            Registrar.Handlers.Register <ZStack, ZStackHandler>();
            Registrar.Handlers.Register <Grid, GridHandler>();
            Registrar.Handlers.Register <Spacer, SpacerHandler>();
            Registrar.Handlers.Register <RadioGroup, RadioGroupHandler>();

            // Device Features
            ModalView.PerformPresent = (o) => {
                PresentingViewController.PresentViewController(o.ToViewController(), true, null);
            };
            ModalView.PerformDismiss = () => PresentingViewController.DismissModalViewController(true);

            ThreadHelper.JoinableTaskContext = new Microsoft.VisualStudio.Threading.JoinableTaskContext();
            ThreadHelper.SetFireOnMainThread(_invoker.BeginInvokeOnMainThread);

            Device.FontService     = new iOSFontService();
            Device.GraphicsService = new iOSGraphicsService();
            Device.BitmapService   = new iOSBitmapService();

            AnimationManger.SetTicker(new iOSTicker());

            //Set Default Style
            var style = new Styles.Style();

            style.Apply();
        }
Exemplo n.º 2
0
        public static void Init()
        {
            if (_hasInitialized)
            {
                return;
            }
            _hasInitialized = true;

            // Controls
            Registrar.Handlers.Register <ActivityIndicator, ActivityIndicatorHandler>();
            Registrar.Handlers.Register <Button, ButtonHandler>();
            Registrar.Handlers.Register <Image, ImageHandler>();
            Registrar.Handlers.Register <ProgressBar, ProgressBarHandler>();
            Registrar.Handlers.Register <SecureField, SecureFieldHandler>();
            Registrar.Handlers.Register <Slider, SliderHandler>();
            Registrar.Handlers.Register <RadioButton, RadioButtonHandler>();
            // Stepper
            Registrar.Handlers.Register <Text, TextHandler>();
            Registrar.Handlers.Register <TextField, TextFieldHandler>();
            Registrar.Handlers.Register <Toggle, ToggleHandler>();
            //Registrar.Handlers.Register<WebView, WebViewHandler> ();

            // Containers
            Registrar.Handlers.Register <ContentView, ContentViewHandler>();
            Registrar.Handlers.Register <ListView, ListViewHandler>();
            Registrar.Handlers.Register <ScrollView, ScrollViewHandler>();
            Registrar.Handlers.Register <View, ViewHandler>();
            Registrar.Handlers.Register <ViewRepresentable, ViewRepresentableHandler>();
            Registrar.Handlers.Register <TabView, TabViewHandler>();
            Registrar.Handlers.Register <NavigationView, NavigationViewHandler>();
            Registrar.Handlers.Register <RadioGroup, RadioGroupHandler>();

            // Layouts
            Registrar.Handlers.Register <HStack, HStackHandler>();
            Registrar.Handlers.Register <VStack, VStackHandler>();
            Registrar.Handlers.Register <ZStack, ZStackHandler>();
            Registrar.Handlers.Register <Grid, GridHandler>();
            Registrar.Handlers.Register <Spacer, SpacerHandler>();

            // Modal Support
            ModalView.PerformPresent = ModalManager.ShowModal;
            ModalView.PerformDismiss = ModalManager.DismisModal;

            // Device Services
            ThreadHelper.JoinableTaskContext = new Microsoft.VisualStudio.Threading.JoinableTaskContext();
            Device.GraphicsService           = new AndroidGraphicsService();
            Device.BitmapService             = new AndroidBitmapService();


            AnimationManger.SetTicker(new AndroidTicker());

            //Set Default Style
            var style = new Style();

            style.Apply();
        }
Exemplo n.º 3
0
        public static void Init()
        {
            if (_hasInitialized)
            {
                return;
            }
            _hasInitialized = true;

            // Controls
            Registrar.Handlers.Register <Button, ButtonHandler>();
            Registrar.Handlers.Register <Image, ImageHandler>();
            Registrar.Handlers.Register <TextField, TextFieldHandler>();
            Registrar.Handlers.Register <Text, TextHandler>();
            Registrar.Handlers.Register <SecureField, SecureFieldHandler>();
            Registrar.Handlers.Register <Slider, SliderHandler>();
            Registrar.Handlers.Register <ShapeView, ShapeViewHandler>();
            Registrar.Handlers.Register <Toggle, ToggleHandler>();
            Registrar.Handlers.Register <RadioButton, RadioButtonHandler>();
            Registrar.Handlers.Register <ProgressBar, ProgressBarHandler>();
            //Registrar.Handlers.Register<WebView, WebViewHandler> ();

            // Containers
            Registrar.Handlers.Register <ScrollView, ScrollViewHandler>();
            Registrar.Handlers.Register <View, ViewHandler>();
            Registrar.Handlers.Register <ContentView, ContentViewHandler>();
            Registrar.Handlers.Register <ListView, ListViewHandler>();
            Registrar.Handlers.Register <ViewRepresentable, ViewRepresentableHandler>();
            Registrar.Handlers.Register <RadioGroup, RadioGroupHandler>();

            // Managed Layout
            Registrar.Handlers.Register <HStack, HStackHandler>();
            Registrar.Handlers.Register <VStack, VStackHandler>();
            Registrar.Handlers.Register <ZStack, ZStackHandler>();
            Registrar.Handlers.Register <Spacer, SpacerHandler>();
            Registrar.Handlers.Register <Grid, GridHandler>();

            // Device Features
            ThreadHelper.JoinableTaskContext = new Microsoft.VisualStudio.Threading.JoinableTaskContext();
            ThreadHelper.SetFireOnMainThread(_invoker.BeginInvokeOnMainThread);
            Device.FontService     = new MacFontService();
            Device.GraphicsService = new MacGraphicsService();
            Device.BitmapService   = new MacBitmapService();


            AnimationManger.SetTicker(new MacTicker());

            //Set Default Style
            var style = new Styles.Style();

            style.Apply();
        }