public async override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); ContinueBtn.Click += ContinueBtn_Click; CarsApi = RestService.For <ICarsApi>(StringConstants.GetGateway()); try { var MyResult = await CarsApi.GetWelcome(); var make = MyResult.Results.Select(car => car.Make).ToList(); brandAdapter = ArrayAdapterClass.CreateArrayAdapter(Activity, make); var model = MyResult.Results.Select(car => car.Model).ToList(); modelAdapter = ArrayAdapterClass.CreateArrayAdapter(Activity, model); } catch (Exception e) { Log.Error("car_reg_fragment", e.Message); } CarYearEt.Adapter = ArrayAdapterClass.CreateArrayAdapter(Activity, CarPropsUtil.GetModelYears()); CarYearEt.TextChanged += TextChanged; CarYearEt.Validator = new Validator(CarYearEt); CarBrandEt.Adapter = brandAdapter; CarBrandEt.TextChanged += TextChanged; CarModelEt.Adapter = modelAdapter; CarModelEt.TextChanged += TextChanged; CarColorEt.Adapter = ArrayAdapterClass.CreateArrayAdapter(Activity, CarPropsUtil.GetColorList()); CarColorEt.TextChanged += TextChanged; CarColorEt.Validator = new Validator(CarColorEt); ConditionEt.Adapter = ArrayAdapterClass.CreateArrayAdapter(Activity, conditions); ConditionEt.TextChanged += TextChanged; ConditionEt.Validator = new Validator(ConditionEt); RegNoEt.EditText.TextChanged += TextChanged; DriverLicenceEt.EditText.TextChanged += TextChanged; }
public AddCarDialog(ICarsApi carsApi) { this.carsApi = carsApi; InitializeComponent(); ThreadPool.QueueUserWorkItem(LoadBrandData); }