예제 #1
0
        private void inicializarComponentes()
        {
            _Origem = new Picker
            {
                Title       = "Estado de origem",
                ItemsSource = Estados
            };

            _Destino = new Picker
            {
                Title       = "Estado de destino",
                ItemsSource = Estados
            };

            _TipoVeiculoEntry = new DropDownList
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                //Margin = 5,
                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);
            };

            _Aplicar = new Button()
            {
                Text = "FILTRAR",
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Style             = Estilo.Current[Estilo.BTN_SUCESSO]
            };
            _Aplicar.Clicked += (sender, e) =>
            {
                Filtered?.Invoke(this, new FreteFiltroInfo
                {
                    Tipo    = (TipoVeiculoInfo)_TipoVeiculoEntry.Value,
                    Destino = (string)_Destino.SelectedItem,
                    Origem  = (string)_Origem.SelectedItem
                });
                Navigation.PopAsync();
            };
        }
예제 #2
0
        private DropDownList criarTipoVeiculoEntry(TipoVeiculoInfo tipo = null)
        {
            var tipoVeiculoEntry = new DropDownList
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                //Margin = 5,
                Placeholder      = "Tipo de Veículo",
                TextColor        = Color.Black,
                PlaceholderColor = Color.Silver,
                Value            = tipo
            };

            tipoVeiculoEntry.Clicked += (sender, e) =>
            {
                var tipoVeiculoPage = new TipoVeiculoSelecionaPage();
                tipoVeiculoPage.AoSelecionar += (object s2, TipoVeiculoInfo e2) =>
                {
                    ((DropDownList)sender).Value = e2;
                };
                Navigation.PushAsync(tipoVeiculoPage);
            };
            return(tipoVeiculoEntry);
        }
        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;
        }
예제 #4
0
        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();
            };
        }