public SelecionarProfessorViewModel(Avaliacao avaliacao) { IsVisible = true; Professores = new ObservableCollection <Professor>(); using (var dao = new ProfessorDAO()) { var profs = dao.GetAtivos(); if (profs != null) { Professores = new ObservableCollection <Professor>(profs); } } SelecionarCommand = new Command(() => { IsVisible = false; var selected = Professores?.Where(x => x.Selected).ToList(); if (selected.Count < 1) { App.Current.MainPage?.DisplayAlert("Selecione o professor", "Nenhum professor selecionado.", "Fechar"); IsVisible = true; return; } var pages = new Views.AvaliarProfessorPage(avaliacao, selected); App.Current.MainPage?.Navigation.PushAsync(pages); IsVisible = true; }); }