private async void Return() { var viewModel = new CourseViewModel(); var page = new CoursePage(_term[0]); { BindingContext = viewModel; }; await this.Navigation.PushAsync(page, true); }
private async void LstTerms_ItemTapped(object sender, ItemTappedEventArgs e) { var term = (Term)e.Item; var courseViewModel = new CourseViewModel(); var coursesList = await App.Database.GetCoursesAsync(); var filteredCourses = coursesList.Where(r => r.TermId == term.Id).ToList(); var courses = new ObservableCollection <Course>(filteredCourses); courseViewModel.Courses = courses; var coursePage = new CoursePage(term, _terms) { BindingContext = courseViewModel }; await this.Navigation.PushAsync(coursePage, true); }