async Task initAsync()
        {
            try
            {
                Foods = new List <Food>();
                List <Models.Product> listP = await productFirebaseHelper.GetAllProduct();

                var itemSourceListStr = new List <string>();


                for (int i = 0; i < listP.Count; i++)
                {
                    Models.Product productM = listP[i];
                    itemSourceListStr.Add(productM.Name);
                    int count = i + 1;
                    Foods.Add(new Food
                    {
                        ID       = count,
                        Name     = productM.Name,
                        NameEn   = productM.NameEn,
                        Location = productM.Location,
                        Details  = productM.Details,
                        //	ImageUrl = "food1.jpg",
                        ImageUrl    = productM.ImageUrl,
                        CostPerUnit = productM.CostPerUnit,
                        Quantity    = productM.Quantity,
                        LevelSpicy  = productM.LevelSpicy

                                      //
                    });
                }

                picker.ItemsSource = itemSourceListStr;



                if (this.GID != null)
                {
                    Models.Product product = await productFirebaseHelper.GetProduct(GID);
                }
            }
            catch (Exception ee)
            {
                string error_str = ee.Message;
                DisplayAlert("Connection Problem", ee.Message, "OK");
            }
        }
Esempio n. 2
0
        public async Task initAsync()
        {
            List <Models.Product> listP = await firebaseHelper.GetAllProduct();

            listView.ItemsSource = listP;
        }