/// <summary> /// Metodo que realiza el guardar. /// Es invocado atraves de cmdSave, al ser presionado el boton de "Guardar" /// </summary> private async void ExecuteSave() { if (_personSeleccionada.IdPersona == 0) { //Añadimos a la BD, a través de la BL //Colocar insertar a la tabla _personSeleccionada.IdPersona = mListaCompleta.ElementAt(mListaCompleta.Count() - 1).IdPersona - 1; await _manejadoraBL.addPersonaAsync(_personSeleccionada); mListaCompleta.Add(_personSeleccionada); //NotifyPropertyChanged("mListaCompleta"); } else { HttpStatusCode mCode = await _manejadoraBL.updatePersonaAsync(_personSeleccionada); if ((int)mCode == 204) { _mListaCompleta = new ObservableCollection <clsPersona>(await _listadoBL.getListadoBL()); _mListaConBusqueda = mListaCompleta; NotifyPropertyChanged("personSeleccionada"); } } }
public async void fillList() { try { _listadoBL = new ListadoPersonasBL(); this._mListaCompleta = new ObservableCollection <clsPersona>(await _listadoBL.getListadoBL()); this._mListaConBusqueda = this._mListaCompleta; _mHabiliteProgressring = false; NotifyPropertyChanged("mListaCompleta"); NotifyPropertyChanged("mListaConBusqueda"); NotifyPropertyChanged("mHabiliteProgressring"); } catch (Exception e) { } //Por la forma en que lo hacemos debemos notificar. No siempre es necesario }