private async void Method_CargaDistrito() { await Task.Factory.StartNew(() => { try { Collection_DatoDistrito.Sources = new BComSoft_Ubigeo().GET_Distrito(Property_SelectItemProvincia.CodUbigeo); if (!string.IsNullOrEmpty(EComSoft_Almacen.EComSoft_Ubigeo.CodUbigeo)) { Property_SelectItemDistrito = Collection_DatoDistrito.FirstOrDefault(x => x.CodUbigeo == ((EComSoft_Almacen.Opcion == "U") ? EComSoft_Almacen.EComSoft_Ubigeo.CodUbigeo : string.Empty)); } } catch (Exception ex) { CHMessageBox.Show(ComSoftMensaje.TituloAlmacen, ex.Message, CHMessageTypeButton.Acept); } }); }
private async void Method_CargaProvincia() { await Task.Factory.StartNew(() => { try { Collection_DatoProvincia.Sources = new BComSoft_Ubigeo().GET_Provincia(Property_SelectItemDepartamento.CodUbigeo); if (!string.IsNullOrEmpty(EComSoft_Almacen.EComSoft_Ubigeo.CodUbigeo)) { Property_SelectItemProvincia = Collection_DatoProvincia.FirstOrDefault(x => x.CodUbigeo == ((EComSoft_Almacen.Opcion == "U") ? EComSoft_Almacen.EComSoft_Ubigeo.CodUbigeo?.Substring(0, 4) : string.Empty)); } Application.Current.Dispatcher.Invoke(() => { Collection_DatoDistrito.Clear(); }); } catch (Exception ex) { CHMessageBox.Show(ComSoftMensaje.TituloAlmacen, ex.Message, CHMessageTypeButton.Acept); } }); }