Esempio n. 1
0
        public RegistroProveedorPage(App7.ServiceReference1.Proveedor p)
        {
            try
            {
                InitializeComponent();

                dataWCF               = DependencyService.Get <IDataStore>();
                BindingContext        = _vm = new RegistroProveedoresViewModel(this, p);
                paisPi.SelectedItem   = p.Pais;
                cuidadPi.SelectedItem = p.Ciudad;
                _vm.LoadTipos();
                tiposPi.ItemsSource = _vm.Items;
                //MyAutoComplete.TextChanged += MyAutoComplete_TextChanged;
                if (!String.IsNullOrEmpty(p.Tipo))
                {
                    tiposPi.SelectedItem = p.Tipo;
                }
                latLb.Text = "" + p.Latitude;
                lonLb.Text = "" + p.Longitude;

                stackL.HeightRequest  = _vm.Prov.L ? 40:0;
                stackM.HeightRequest  = _vm.Prov.M ? 40 : 0;
                stackMi.HeightRequest = _vm.Prov.Mi ? 40 : 0;
                stackJ.HeightRequest  = _vm.Prov.J ? 40 : 0;
                stackV.HeightRequest  = _vm.Prov.V ? 40 : 0;
                stackS.HeightRequest  = _vm.Prov.S ? 40 : 0;
                stackD.HeightRequest  = _vm.Prov.D ? 40 : 0;
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 2
0
        public ProveedorPage(App7.ServiceReference1.Proveedor prov)
        {
            try
            {
                InitializeComponent();
                //imageLoad.IsVisible = true;
                //imageLoad.IsRunning = true;
                flowList.FlowItemTapped += FlowList_FlowItemTapped;
                verMapaBt.IsEnabled      = false;
                verMapaStack.IsVisible   = false;

                viewModel            = new ProveedorViewModel(prov, this);
                viewModel.SetHeight += ViewModel_SetHeight;
                BindingContext       = viewModel;
                if (prov != null && prov.Latitude == 0 && prov.Longitude == 0)
                {
                    verMapaBt.IsEnabled    = false;
                    verMapaStack.IsVisible = false;
                }
                else
                {
                    verMapaBt.IsEnabled    = true;
                    verMapaStack.IsVisible = true;
                }
                if (String.IsNullOrEmpty(prov.NumeroTelefono))
                {
                    llamarStack.IsVisible = false;
                }
                else
                {
                    llamarStack.IsVisible = true;
                }
                Load();
            }
            catch (Exception ex)
            {
            }
        }