Esempio n. 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            cal_tab         = new CalendarTabVC();
            cal_tab.Title   = "Calendar";
            chart_tab       = new ChartTabVC();
            chart_tab.Title = "WeightChart";
            pref_tab        = new InAppPrefsVC();
            pref_tab.Title  = "Preferencies";

            var tabs = new UIViewController[] { cal_tab, chart_tab, pref_tab };

            ViewControllers        = tabs;
            SelectedViewController = cal_tab;

            cal_tab.TabBarItem   = new UITabBarItem(UITabBarSystemItem.History, 0);
            chart_tab.TabBarItem = new UITabBarItem(UITabBarSystemItem.MostRecent, 1);
            pref_tab.TabBarItem  = new UITabBarItem(UITabBarSystemItem.More, 2);
        }
Esempio n. 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile("Images/png/[email protected]"));
            //this.View.InsertSubview (new UIImageView(UIImage.FromBundle("Images/png/background-menu.png")),0);
            this.RulesBtn.TouchUpInside += (sender, e) => {
                // add pages
                DukappPagedDataSource qsrc = new DukappPagedDataSource(5);
                DukappPagedVC         mp   = new DukappPagedVC(qsrc);
                TextVC mainrules           = new TextVC(RecordManager.GetRuleForStage(new  DietPhase(DietPhaseId.DP_Default)), new DietPhase(DietPhaseId.DP_Default).ToPrintString());
                mainrules.m_PageIndex = 0;
                TextVC attacktxt = new TextVC(RecordManager.GetRuleForStage(new  DietPhase(DietPhaseId.DP_Attack)), new DietPhase(DietPhaseId.DP_Attack).ToPrintString());
                attacktxt.m_PageIndex = 1;
                TextVC cruisecktxt = new TextVC(RecordManager.GetRuleForStage(new  DietPhase(DietPhaseId.DP_Cruise)), new DietPhase(DietPhaseId.DP_Cruise).ToPrintString());
                cruisecktxt.m_PageIndex = 2;
                TextVC constxt = new TextVC(RecordManager.GetRuleForStage(new  DietPhase(DietPhaseId.DP_Consolidation)), new DietPhase(DietPhaseId.DP_Consolidation).ToPrintString());
                constxt.m_PageIndex = 3;
                TextVC stabtxt = new TextVC(RecordManager.GetRuleForStage(new  DietPhase(DietPhaseId.DP_Stabilization)), new DietPhase(DietPhaseId.DP_Stabilization).ToPrintString());
                stabtxt.m_PageIndex = 4;
                mp.m_pages.Add(mainrules);
                mp.m_pages.Add(attacktxt);
                mp.m_pages.Add(cruisecktxt);
                mp.m_pages.Add(constxt);
                mp.m_pages.Add(stabtxt);
                mp.SetViewControllers(new UIViewController[] { mainrules }, UIPageViewControllerNavigationDirection.Forward, true, null);
                this.NavigationController.PushViewController(mp, true);
            };
            this.ScheduleBtn.TouchUpInside += (sender, e) => {
                DukappPagedDataSource qsrc = new DukappPagedDataSource(3);
                DukappPagedVC         mp   = new DukappPagedVC(qsrc);
                mp.View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile("Images/png/[email protected]"));
                CalendarTabVC calendar = new CalendarTabVC();
                calendar.m_PageIndex = 0;
                ChartTabVC chart = new ChartTabVC();
                chart.m_PageIndex = 1;
                InAppPrefsVC prefs = new InAppPrefsVC();
                prefs.m_PageIndex = 2;
                mp.m_pages.Add(calendar);
                mp.m_pages.Add(chart);
                mp.m_pages.Add(prefs);
                mp.SetViewControllers(new UIViewController[] { calendar }, UIPageViewControllerNavigationDirection.Forward, true, null);
                this.NavigationController.PushViewController(mp, true);
            };
            this.RecBtn.TouchUpInside += (sender, e) => {
                if (this.recipesScreen == null)
                {
                    this.recipesScreen = new RecipesVC();
                }
                //this.NavigationController.NavigationBarHidden = false;
                this.NavigationController.PushViewController(this.recipesScreen, true);
            };

            /*this.MealsBtn.TouchUpInside += (sender, e) => {
             *      if(this.mealsScreen == null)
             *      { this.mealsScreen = new MealsVC(); }
             * this.NavigationController.NavigationBarHidden = false;
             *      this.NavigationController.PushViewController(this.mealsScreen, true);
             * };*/


            this.BasketBtn.TouchUpInside += (sender, e) => {
                if (this.basketScreen == null)
                {
                    this.basketScreen = new BasketVC();
                }
                //this.NavigationController.NavigationBarHidden = false;
                this.NavigationController.PushViewController(this.basketScreen, true);
            };

            /*this.GuidanceBtn.TouchUpInside += (sender, e) => {
             *      if(this.guidanceScreen == null)
             *      { this.guidanceScreen  = new GuidanceVC(); }
             * this.NavigationController.NavigationBarHidden = false;
             *      this.NavigationController.PushViewController(this.guidanceScreen, true);
             * };*/
        }