private async void ExecuteBuscaCommand(object obj) { /* * //Aqui ocorre a busca * var resultado = new List<ItemLista>() * { * new ItemLista() * { * Id = "218704", * Thumbnail = new ItemThumbnail(){ * Value = "https://cf.geekdo-images.com/images/pic2823310_t.jpg" * }, * Nome = new ItemNome() * { * Value = "nome do livro" * }, * AnoPublicacao = new ItemAnoPublicacao() * { * Value = "2017" * } * }, * new ItemLista() * { * Id = "218704", * Thumbnail = new ItemThumbnail(){ * Value = "https://cf.geekdo-images.com/images/pic2823310_t.jpg" * }, * Nome = new ItemNome() * { * Value = "nome do livro" * }, * AnoPublicacao = new ItemAnoPublicacao() * { * Value = "2017" * } * } * }; */ IsLoading = true; var resultado = await BGGClient.GetItems(QueryBusca); //Lista.Clear(); foreach (var itemResultado in resultado) { Lista.Add(itemResultado); } IsLoading = false; }
public override async Task LoadAsync() { IsLoading = true; if (Lista.Count == 0) { Lista.Clear(); var resultado = await BGGClient.GetItems(); foreach (var item in resultado) { Lista.Add(item); } } IsLoading = false; }