public IngredientDetailsPage(IngredientDetailViewModel viewModel)
        {
            NavigationPage.SetHasNavigationBar(this, false);
            InitializeComponent();

            BindingContext = viewModel;
            SelectedUnits.SelectedIndex = 0;
        }
        public IngredientDetailPage()
        {
            InitializeComponent();

            var ing = new SimpleIngredient();

            viewModel      = new IngredientDetailViewModel(ing);
            BindingContext = viewModel;
        }
        public IngredientDetailPage(IngredientDetailViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = this.viewModel = viewModel;

            AddFav.Command    = new Command(AddFav_OnClicked);
            RemoveFav.Command = new Command(RemoveFav_OnClicked);
        }
Example #4
0
        public async Task <IActionResult> Detail(Guid id)
        {
            var ingredient = await _ingredientFacade.GetByIdAsync(id);

            var ingredientDetailViewModel = new IngredientDetailViewModel
            {
                IngredientDetail = ingredient
            };

            return(View(ingredientDetailViewModel));
        }
Example #5
0
        public ItemDetailPage()
        {
            InitializeComponent();

            var item = new FoodItem
            {
                Name    = "Item 1",
                UnitsID = 22
            };

            viewModel      = new IngredientDetailViewModel(item);
            BindingContext = viewModel;
        }
Example #6
0
        /// <summary>
        /// Handles the actions to do when this activity is created
        /// </summary>
        /// <param name="savedInstanceState">Saved instance state.</param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var data = Intent.GetStringExtra("data");

            senderRow     = Intent.GetIntExtra("row", 0);
            ingredient    = Newtonsoft.Json.JsonConvert.DeserializeObject <Ingredient>(data);
            viewModel     = new IngredientDetailViewModel(ingredient);
            foodGroupView = FindViewById <TextView>(Resource.Id.foodgroup_ingredientDetail);
            allergenView  = FindViewById <TextView>(Resource.Id.allergen_ingredientDetail);
            unitView      = FindViewById <TextView>(Resource.Id.unit_ingredientDetail);
            priceView     = FindViewById <TextView>(Resource.Id.price_ingredientDetail);
        }
Example #7
0
 public IngredientDetailView(IngredientDetailViewModel ingredientDetailViewModel)
     : base(ingredientDetailViewModel)
 {
     InitializeComponent();
 }
Example #8
0
        public ItemDetailPage(IngredientDetailViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = this.viewModel = viewModel;
        }