Ejemplo n.º 1
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            var foodItems = await App.DB.getFoodItemsAsync();


            /* Wykorzystanie CHMURY */
            //var response = await new Services.MenuRestService().Client.GetAsync("  nasz link do azure website   ");  // pobranie z chmury
            //if (response.StatusCode == System.Net.HttpStatusCode.OK)
            //{
            //    var menusCloudJSON = await response.Content.ReadAsStringAsync(); // wyciągniecie zawartości
            //    foodItems.AddRange(Newtonsoft.Json.JsonConvert.DeserializeObject<List<FoodItem>>(menusCloudJSON));
            //}
            /* KONIEC */


            foodItems.ForEach(td => td.Image = Path.Combine(Environment.GetFolderPath(
                                                                Environment.SpecialFolder.LocalApplicationData), td.Image + ".jpg"));

            var menugroupsvm = new MenuGroupsViewModel(foodItems);

            menuListView.ItemsSource = menugroupsvm.MenuGroups;



            // menuListView.ItemsSource = MenuGroups.MenuGroupsList(foodItems);   pierwotna wersja z zajęć
        }
Ejemplo n.º 2
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            var foodItems = await App.DB.getFoodItemsAsync();

            foodItems.ForEach(td => td.Image = Path.Combine(Environment.GetFolderPath(
                                                                Environment.SpecialFolder.LocalApplicationData), td.Image + ".jpg"));

            // menuListView.ItemsSource = MenuGroups.MenuGroupsList(foodItems);  pierwotna wersja z zajęć
            var menugroupsvm = new MenuGroupsViewModel(foodItems);

            menuListView.ItemsSource = menugroupsvm.MenuGroups;
        }