async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { Contactos.Clear(); var items = await this.service.ObtenerContactos(); foreach (var item in items) { Contactos.Add(item); } } catch (Exception) { // Log errores } finally { IsBusy = false; } }
public void ReadContacts() { var contactos = Contact.ReadContacts(); Contactos.Clear(); foreach (var contacto in contactos) { Contactos.Add(contacto); } }
async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { Contactos.Clear(); Contactos = await GeneradorContacto.CrearContactos(); } catch (Exception ex) { // Log errores } finally { IsBusy = false; } }