Example #1
0
        private DropDownList criarCarroceriaEntry(TipoCarroceriaInfo carroceria = null)
        {
            var carroceriaEntry = new DropDownList
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                //Margin = 5,
                Placeholder      = "Tipo de Carroceria",
                TextColor        = Color.Black,
                PlaceholderColor = Color.Silver,
                Value            = carroceria
            };

            carroceriaEntry.Clicked += (sender, e) =>
            {
                var carroceriaPage = new CarroceriaSelecionaPage();
                carroceriaPage.AoSelecionar += (object s2, TipoCarroceriaInfo e2) =>
                {
                    ((DropDownList)sender).Value = e2;
                };
                Navigation.PushAsync(carroceriaPage);
            };
            return(carroceriaEntry);
        }
        private void inicializarComponente()
        {
            _TipoVeiculoEntry = new DropDownList
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                Placeholder       = "Tipo de Veículo",
                TextColor         = Color.Black,
                PlaceholderColor  = Color.Silver
            };
            _TipoVeiculoEntry.Clicked += (sender, e) =>
            {
                var tipoVeiculoPage = new TipoVeiculoSelecionaPage();
                tipoVeiculoPage.AoSelecionar += (object s2, Model.TipoVeiculoInfo e2) =>
                {
                    _TipoVeiculoEntry.Value = e2;
                };
                Navigation.PushAsync(tipoVeiculoPage);
            };

            _CarroceriaEntry = new DropDownList
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                Placeholder       = "Tipo de Carroceria",
                TextColor         = Color.Black,
                PlaceholderColor  = Color.Silver
            };
            _CarroceriaEntry.Clicked += (sender, e) =>
            {
                var carroceriaPage = new CarroceriaSelecionaPage();
                carroceriaPage.AoSelecionar += (object s2, Model.TipoCarroceriaInfo e2) =>
                {
                    _CarroceriaEntry.Value = e2;
                };
                Navigation.PushAsync(carroceriaPage);
            };
            _CNHEntry = new XfxEntry
            {
                Placeholder       = "CNH",
                Keyboard          = Keyboard.Numeric,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                ErrorDisplay      = ErrorDisplay.None,
                Style             = Estilo.Current[Estilo.ENTRY_MATERIAL]
            };

            _VeiculoEntry = new XfxEntry
            {
                Placeholder       = "Veículo",
                Keyboard          = Keyboard.Text,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                ErrorDisplay      = ErrorDisplay.None
            };
            _PlacaEntry = new XfxEntry
            {
                Placeholder       = "Placa",
                Keyboard          = Keyboard.Text,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                Style             = Estilo.Current[Estilo.ENTRY_MATERIAL],
                ErrorDisplay      = ErrorDisplay.None
            };
            _ANTTEntry = new XfxEntry
            {
                Placeholder       = "ANTT",
                Keyboard          = Keyboard.Text,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                Style             = Estilo.Current[Estilo.ENTRY_MATERIAL],
                ErrorDisplay      = ErrorDisplay.None
            };
            _CadastroButton = new Button()
            {
                Text = "CADASTRAR",
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Style             = Estilo.Current[Estilo.BTN_PRINCIPAL]
            };
            _CadastroButton.Clicked += CadastroClicked;
        }
        private void inicializarComponente()
        {
            _Tipo = new SelecionarEntry
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                Margin            = 5
            };
            _Tipo.setHintText("Tipo de Veículo");
            _TipoVeiculo = new TipoVeiculoSelecionaPage();
            _TipoVeiculo.AoSelecionar += (sender, e) => {
                _Tipo.Info = e;
            };
            _Tipo.Clicked += (sender, e) =>
            {
                Navigation.PushAsync(_TipoVeiculo);
            };


            _Carroceria = new SelecionarEntry
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                Margin            = 5
            };
            _Carroceria.setHintText("Tipo de Carroceria");
            _TipoCarroceria = new CarroceriaSelecionaPage();
            _TipoCarroceria.AoSelecionar += (sender, e) => {
                _Carroceria.Info = e;
            };
            _Carroceria.Clicked += (sender, e) =>
            {
                Navigation.PushAsync(_TipoCarroceria);
            };

            _PesoEntry = new Entry
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                //WidthRequest = 120,
                //HeightRequest = 30,
                BackgroundColor         = Estilo.Current.PrimaryColor,
                TextColor               = Color.White,
                FontSize                = 14,
                Keyboard                = Keyboard.Numeric,
                HorizontalTextAlignment = TextAlignment.End,
                //Text = "80"
            };

            _LarguraEntry = new Entry
            {
                VerticalOptions         = LayoutOptions.Start,
                HorizontalOptions       = LayoutOptions.Fill,
                BackgroundColor         = Estilo.Current.PrimaryColor,
                TextColor               = Color.White,
                FontSize                = 14,
                Keyboard                = Keyboard.Numeric,
                HorizontalTextAlignment = TextAlignment.End,
                //Text = "40"
            };

            _AlturaEntry = new Entry
            {
                VerticalOptions         = LayoutOptions.Start,
                HorizontalOptions       = LayoutOptions.Fill,
                BackgroundColor         = Estilo.Current.PrimaryColor,
                TextColor               = Color.White,
                FontSize                = 14,
                Keyboard                = Keyboard.Numeric,
                HorizontalTextAlignment = TextAlignment.End,
                //Text = "60"
            };

            _ProfundidadeEntry = new Entry
            {
                VerticalOptions         = LayoutOptions.Start,
                HorizontalOptions       = LayoutOptions.Fill,
                BackgroundColor         = Estilo.Current.PrimaryColor,
                TextColor               = Color.White,
                FontSize                = 14,
                Keyboard                = Keyboard.Numeric,
                HorizontalTextAlignment = TextAlignment.End,
                //Text = "10"
            };



            _EnviarButton = new Button
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Margin            = new Thickness(8, 0),
                Style             = Estilo.Current[Estilo.BTN_PRINCIPAL],
                Text = "Continuar"
            };
            _EnviarButton.Clicked += (sender, e) => {
                continuaPedido();
            };
        }