private async void MenuView_OnItemSelected(object sender, SelectedItemChangedEventArgs e) { if (MenuView.SelectedItem == null) { return; } navigationDrawer.ToggleDrawer(); MenuView.SelectedItem = null; switch (e.SelectedItemIndex) { case 0: SelectedPage = PageType.CoursePortal; MainContentView.Content = _selectCourse; await _selectCourse.LoadCoursesAsync(); break; case 1: SelectedPage = PageType.RegisterCourses; var r = new RegisterCoursesContentView(); r.CourseRegisterUpdate += ROnCourseRegisterUpdate; r.ErrorOccured += ROnErrorOccured; MainContentView.Content = r; await r.LoadCourses(); break; case 2: SelectedPage = PageType.Attendance; MainContentView.Content = _selectCourse; await _selectCourse.LoadCoursesAsync(); break; case 3: SelectedPage = PageType.Result; var rv = new ResultContentView(); MainContentView.Content = rv; await rv.Load(); break; case 4: SelectedPage = PageType.FeeChallan; MainContentView.Content = new FeeChallanContentView(); break; case 5: SelectedPage = PageType.Setting; var s = new SettingContentView(); MainContentView.Content = s; s.Updated += ROnCourseRegisterUpdate; await s.Load(); break; } }
public MainView() { InitializeComponent(); _dashboard = new DashboardContentView(); Task.Run(async() => { await _dashboard.LoadEverything(); }); MainContentView.PropertyChanged += MainContentViewOnPropertyChanged; _selectCourse = new SelectCourseContentView(); _selectCourse.CourseSelected += SelectCourseOnCourseSelected; var s = new ResultContentView(); MainContentView.Content = _dashboard; if (Global.CurrentStudent == null) { return; } LblStudentName.Text = CurrentStudent.Name; }