Esempio n. 1
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            //[Take Row]
            RecipeTWCell cell = tableView.CellAt(indexPath) as RecipeTWCell;

            if (cell != null)
            {
                if (cell.m_bWasChanged)
                {
                    RecipeRecord rec = RecipeManager.GetRecipeRecord(m_tableItems[indexPath.Row].ID);
                    rec.isFavourite = cell.m_bChecked ? 1 : 0;
                    RecipeManager.SaveRecipeRecord(rec);
                    cell.m_bWasChanged = false;
                }
                else
                {
                    // add pages
                    DukappPagedDataSource qsrc = new DukappPagedDataSource(2);
                    DukappPagedVC         mp   = new DukappPagedVC(qsrc);
                    MealsVC     rec_meals      = new MealsVC(m_tableItems[indexPath.Row], m_parent_vc);
                    HowToCookVC cook_vc        = new HowToCookVC(m_tableItems[indexPath.Row]);
                    mp.m_pages.Add(rec_meals);
                    mp.m_pages.Add(cook_vc);
                    mp.SetViewControllers(new UIViewController[] { rec_meals }, UIPageViewControllerNavigationDirection.Forward, true, null);
                    m_parent_vc.NavigationController.PushViewController(mp, true);
                }
            }
        }
Esempio n. 2
0
        public override void AccessoryButtonTapped(UITableView tableView, NSIndexPath indexPath)
        {
            //List<RecipeMealsRecord> meals = RecipeManager.GetMealsForRecipe();
            MealsVC rec_meals = new MealsVC(m_tableItems[indexPath.Row], m_parent_vc);

            m_parent_vc.NavigationController.PushViewController(rec_meals, true);
        }
Esempio n. 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.RulesBtn.TouchUpInside += (sender, e) => {
                if (this.rulesView == null)
                {
                    this.rulesView = new RulesVC();
                }
                this.NavigationController.PushViewController(this.rulesView, true);
            };
            this.ScheduleBtn.TouchUpInside += (sender, e) => {
                if (this.scheduleView == null)
                {
                    this.scheduleView = new ScheduleVC();
                }
                this.NavigationController.PushViewController(this.scheduleView, true);
            };
            this.MealsBtn.TouchUpInside += (sender, e) => {
                if (this.mealsScreen == null)
                {
                    this.mealsScreen = new MealsVC();
                }
                this.NavigationController.PushViewController(this.mealsScreen, true);
            };
            this.RecipesBtn.TouchUpInside += (sender, e) => {
                if (this.recipesScreen == null)
                {
                    this.recipesScreen = new RecipesVC();
                }
                this.NavigationController.PushViewController(this.recipesScreen, true);
            };

            this.BasketBtn.TouchUpInside += (sender, e) => {
                if (this.basketScreen == null)
                {
                    this.basketScreen = new BasketVC();
                }
                this.NavigationController.PushViewController(this.basketScreen, true);
            };
            this.GuidanceBtn.TouchUpInside += (sender, e) => {
                if (this.guidanceScreen == null)
                {
                    this.guidanceScreen = new GuidanceVC();
                }
                this.NavigationController.PushViewController(this.guidanceScreen, true);
            };
            // Perform any additional setup after loading the view, typically from a nib.
        }