示例#1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            ManagerReportViewModel vm = (ManagerReportViewModel)this.BindingContext;

            this.BindingContext = vm;
        }
示例#2
0
        void InitManagerMode(MotherPage page, List <Course> courseList)
        {
            ManagerHomePage      homePage      = new ManagerHomePage();
            ManagerHomeViewModel homeViewModel = new ManagerHomeViewModel(courseList);

            HomeViewModel           = homeViewModel;
            homePage.BindingContext = homeViewModel;

            ManagerReportPage      reportPage      = new ManagerReportPage();
            ManagerReportViewModel reportViewModel = new ManagerReportViewModel(courseList);

            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);
            });
        }