protected override void OnAppearing() { base.OnAppearing(); ClientReportViewModel vm = (ClientReportViewModel)this.BindingContext; this.BindingContext = vm; }
void InitClientMode(MotherPage page, List <Course> courseList) { ClientHomePage homePage = new ClientHomePage(); ClientHomeViewModel homeViewModel = new ClientHomeViewModel(courseList); HomeViewModel = homeViewModel; homePage.BindingContext = homeViewModel; ClientReportPage reportPage = new ClientReportPage(); ClientReportViewModel reportViewModel = new ClientReportViewModel(); ReportViewModel = reportViewModel; reportPage.BindingContext = reportViewModel; // ForumPage forumPage = new ForumPage (); // ForumListPageViewModel forumViewModel = new ForumListPageViewModel (courseList); // ForumViewModel = forumViewModel; // forumPage.BindingContext = forumViewModel; SettingPage settingPage = new SettingPage(); SettingViewModel settingViewModel = new SettingViewModel(); SettingViewModel = settingViewModel; settingPage.BindingContext = new SettingViewModel(); Device.BeginInvokeOnMainThread(() => { page.Children.Add(homePage); page.Children.Add(reportPage); //page.Children.Add (forumPage); page.Children.Add(settingPage); NavigationHandler.GlobalNavigator.Navigation.PushAsync(page, true); }); }