public async void FetchDestStructAsync() { App.Dispatcher.Invoke(() => { IsDestStructFetchEnabled = false; }); var provinces = await HttpClient.GetDestStructAsync(); lock (Provinces) { App.Dispatcher.Invoke(() => { if (provinces == null) { State.Message = "加载错误"; } else { int index = ProvinceIndex; Provinces.ReplaceItems(provinces); Provinces.Insert(0, FrameWork.Dto.Province.All); if (index >= 0 && index < Provinces.Count) { ProvinceIndex = index; } else { ProvinceIndex = 0; } } }); } App.Dispatcher.Invoke(() => { IsDestStructFetchEnabled = true; }); }