예제 #1
0
        private async void OnLoad(object sender)
        {
            var _error = false;

            StaticSourcesViewModel.ShowProgressLoading("Espere un momento...");
            try
            {
                await Task.Factory.StartNew(() => {
                    CargarCentros(true);
                    LlenarEstatusDisponibles();
                    CargaCatalogo("S", true);
                })
                .ContinueWith((prevTask) => {
                    SelectedCentro  = Centros.First(w => w.ID_CENTRO == -1);
                    SelectedEstatus = Lista_Estatus.LISTA_ESTATUS.First(w => w.CLAVE == "S");
                });

                StaticSourcesViewModel.CloseProgressLoading();
            }
            catch (Exception ex)
            {
                _error = true;
            }
            if (_error)
            {
                StaticSourcesViewModel.CloseProgressLoading();
                await _dialogCoordinator.ShowMessageAsync(this, "Error", "Hubo un error al cargar los catalogos. Favor de contactar al administrador");
            }
        }