private void ReloadList()
        {
            var vegetables = App.FromServer;

            stack.Children.Clear();             // get rid of activity indicator
            foreach (Vegetable veg in vegetables)
            {
                var viewmodel = new VegetableCellPageModel(veg);
                viewmodel.IsAddBtnVisible = true;
                var page = new VegetableCellPage();
                page.BindingContext = viewmodel;
                stack.Children.Add(
                    page
                    );
            }
        }
Exemple #2
0
        void ReloadList()
        {
            var vegetables = App.Favorites;

            stack.Children.Clear();
            foreach (var veg in vegetables)
            {
                var viewmodel = new VegetableCellPageModel(veg);
                var page      = new VegetableCellPage();
                page.BindingContext       = viewmodel;
                viewmodel.IsAddBtnVisible = false;
                viewmodel.FaveBtnText     = "Remove";
                viewmodel.FaveBtnColor    = Color.Red;
                stack.Children.Add(
                    page
                    );
            }
        }