Exemplo n.º 1
0
        public FoodAddPage()
        {
            Food = new FoodModels.Food()
            {
                Name         = "",
                Calories     = 0,
                Fat          = 0,
                Carbs        = 0,
                Fiber        = 0,
                Natrium      = 0,
                Portion      = 100,
                PortionType  = 0,
                Protein      = 0,
                SaturatedFat = 0,
                Sugar        = 0
            };

            PortionItems = PortionTypeItem.PortionTypeItems();

            SelectedPortion = PortionItems[0];

            InitializeComponent();
            BarCode.Text = Food.BarCode;

            BindingContext = this;
        }
Exemplo n.º 2
0
        public FoodDetailPage(FoodModels.Food food)
        {
            Food = food.Clone() as FoodLog.FoodModels.Food;
            InitializeComponent();

            PortionItems = PortionTypeItem.PortionTypeItems();

            SelectedPortion = PortionItems[0];
            BarCode.Text    = Food.BarCode;

            BindingContext = this;
        }