async Task ExecuteLoadProjetoCommand() { if (IsBusy) { return; } IsBusy = true; try { Projetos.Clear(); var projetos = DataProjeto.GetProjetos(true); Projetos.ReplaceRange(projetos); } catch (Exception ex) { Debug.WriteLine(ex); await _messageService.msgErroAsync("Não foi possível carregar os projetos"); } finally { IsBusy = false; } }
private async Task ObterProjetos() { var projetos = await ProjetoService.ObterTodos(); if (Projetos.Count > 0) { Projetos.Clear(); } foreach (var projeto in projetos) { Projetos.Add(projeto); } }