コード例 #1
0
        public DrinksPage(Drink drinkForEdit = null)
        {
            MenuHeaderModel.Instance.ShowPlusMinus = false;
            try
            {
                if (drinkForEdit == null)
                {
                    thisDrinksPageModel = new DrinksPageModel();
                }
                else
                {
                    isEditingDrink      = true;
                    thisDrinksPageModel = new DrinksPageModel(drinkForEdit);
                }

                try
                {
                    InitializeComponent();
                }
                catch (Exception ex)
                {
                    var error = ex.InnerException;
                    throw;
                }


                BindingContext = thisDrinksPageModel;

                Footer.FooterPageModel.IsDrinkPageDisplayed    = true;
                Footer.FooterPageModel.DisplayAddToOrderButton = true;
                Footer.FooterPageModel.AddToOrderButtonText    = "Add Drinks";
                Footer.FooterPageModel.ThisDrinksPageModel     = thisDrinksPageModel;
                string drinkTitle = "TBL " + OrderManager.Instance.CurrentTableName + " Drinks";
                this.ToolbarItems.Add(new ToolbarItem {
                    Text = drinkTitle
                });
                thisDrinksPageModel.ScrollToTopOfList += HandleScrollToTopOfList;
                MenuScrollView.Scrolled += MenuScrollView_Scrolled;
            }
            catch (Exception ex)
            {
                var error = ex.InnerException;
                throw;
            }
        }
コード例 #2
0
 public CircleButtonPlusMinus()
 {
     InitializeComponent();
     BindingContext = new DrinksPageModel();
 }