private void LoadCity() { IsLoadingCity = true; DispatcherHelper.UIDispatcher.Invoke(new Action(Citys.Clear)); var action = new Action(() => { var temp = CityData.GetCity(SelectedProvince.City); if (temp != null) { foreach (var item in temp) { DispatcherHelper.UIDispatcher.Invoke(new Action <CityModel>(Citys.Add), item); } } SelectCity(); }); Task.Factory.StartNew(action).ContinueWith((task) => { DispatcherHelper.UIDispatcher.Invoke(new Action(() => { IsLoadingCity = false; })); }); }
/// <summary> /// 初始修改信息 /// </summary> /// <param name="dto"></param> public void InitModify(BankCardDto dto) { ModifyBankCardDto = dto; BankBranch = dto.BankBranch; CardNo = dto.CardNo; SelectedBankInfo = Banks.FirstOrDefault(p => p.Name.Equals(dto.Name)); SelectedState = States.FirstOrDefault(p => p.State.Equals(dto.Province)); Citys = CityData.GetCity(dto.Province); SelectedCity = Citys.FirstOrDefault(p => p.City.Equals(dto.City)); IsAdded = false; }
public JsonResult GetCity(string areaName) { List <CityModel> list = CityData.GetCity(areaName); return(Json(list, JsonRequestBehavior.AllowGet)); }
public Collection <City> GetCity() { return(_city.GetCity()); }