private void CarNumberCB_TextChanged(object sender, TextChangedEventArgs e) { String text = CarNumberCB.Text; if (text.Length <= 1) { isSelectCar = false; return; } if (isSelectCar == true) { return; } if (text.Length > 0) { List <CarInfo> list = CarInfoModel.FuzzySearch(text); if (list.Count <= 0) { isSelectCar = false; } else { this.CarNumberCB.ItemsSource = null; this.CarNumberCB.ItemsSource = list; this.CarNumberCB.IsDropDownOpen = true; } } }
private void CarNumberCb_TextChanged(object sender, TextChangedEventArgs e) { String text = this.CarNumberCb.Text.Trim(); if (text.Length <= 0) { isCarInfoSelectioned = false; car = null; this.CarNumberCb.IsDropDownOpen = false; SetCarInfo(); return; } if (isCarInfoSelectioned == true) { return; } if (IsHasSendCarBill == true) { return; } if (isOutFactory == true) { return; } if (text.Length >= 2) { List <CarInfo> list = CarInfoModel.FuzzySearch(text); if (list.Count > 0) { isCarInfoSelectioned = true; } this.tempCars.Clear(); foreach (var item in list) { this.tempCars.Add(item.id, item); } this.CarNumberCb.ItemsSource = this.tempCars.Values.ToList(); if (CarNumberCb.ItemsSource != null) { this.CarNumberCb.IsDropDownOpen = true; } } else { this.CarNumberCb.ItemsSource = App.tempCars.Values.ToList(); } }