Ejemplo n.º 1
0
 // invisible next button
 public void CheckNextButton(string categoryName)
 {
     if (_pageControl.Page.Equals(_model.GetMaxPage(categoryName)))
     {
         _isNextButtonVisible = false;
     }
     else
     {
         _isNextButtonVisible = true;
     }
 }
Ejemplo n.º 2
0
        // create and change buttons & page
        public void DisplayTabPageContent(string categoryName)
        {
            ShowPageButton();
            List <Meal> mealList = _mealControl.GetMealOfCategory(categoryName);

            for (int index = (_pageControl.Page - 1) * MAX_BUTTONS; index < _pageControl.Page * MAX_BUTTONS; index++)
            {
                if (index >= mealList.Count)
                {
                    break;
                }
                int  columnIndex = index / MAX_COLUMNS - (_pageControl.Page - 1) * MAX_COLUMNS;
                int  rowIndex    = index % MAX_COLUMNS;
                Meal mealButton  = mealList[index];
                CreateMealButton(mealButton, rowIndex, columnIndex);
            }
            _pageLabel.Text = "Page : " + _pageControl.Page + " / " + _model.GetMaxPage(categoryName);
        }