private async void GetCars() { CarsViewModel carsViewModel = new CarsViewModel(); await carsViewModel.ShippingCarGetter(); Cars = carsViewModel.ShippingCars.ToList(); }
private async void GetCars() { if (CrossConnectivity.Current.IsConnected) { CarsViewModel carsViewModel = new CarsViewModel(); await carsViewModel.ShippingCarGetter(); Cars = carsViewModel.ShippingCars.ToList(); CarsType = carsViewModel.CarTypes.ToList(); } else { Errorlbl.IsVisible = true; Errorlbl.Text = AppResources.ErrorMessage; } }
private async void StackTapped(object sender, EventArgs e) { Activ.IsRunning = true; if (ModelFrame.IsVisible != true) { ModelFrame.IsVisible = true; ModelActive.IsRunning = true; } StackLayout f = (StackLayout)sender; string cartypenamestring = string.Empty; var fcontent = f.Children; var reqLabel = fcontent[0]; var theLabel = reqLabel.GetType(); if (theLabel == typeof(Label)) { Label emailLabel = (Label)reqLabel; cartypenamestring = emailLabel.Text; CarsViewModel cars = new CarsViewModel(); await cars.ShippingCarGetter(); Cars = cars.ShippingCars.Where(o => o.cartypename == cartypenamestring).ToList(); if (Cars.Count() == 0) { Pinslbl.IsVisible = false; MainMap.Pins = Cars; } else { Pinslbl.IsVisible = true; } CarsType = cars.CarTypes.Where(o => o.name == cartypenamestring).ToList(); foreach (var item in CarsType) { var CarModelList = item.carmodals; foreach (var modelitem in CarModelList) { var ModelIcon = modelitem.icon; modelitem.icon = "http://waselksa.alsalil.net/users/images/" + ModelIcon; } Modellist.ItemsSource = CarModelList; ModelActive.IsRunning = false; } } }
private async void AllStack_Tapped(object sender, EventArgs e) { if (ModelFrame.IsVisible == true) { ModelFrame.IsVisible = false; ModelActive.IsRunning = false; } CarsViewModel cars = new CarsViewModel(); await cars.ShippingCarGetter(); Cars = cars.ShippingCars.ToList(); MainMap.Pins = Cars; if (Cars.Count() != 0) { Pinslbl.IsVisible = false; MainMap.Pins = Cars; } else { Pinslbl.IsVisible = true; } Activ.IsRunning = false; }