Esempio n. 1
0
        private async void FoodResults_ItemTapped(object sender, ItemTappedEventArgs e) //When tapped the savedfood icon, it gets it uri and then makes an api call for the uri
        {
            var recDets      = (SavedFoodTable)e.Item;
            var itemUri      = recDets.Uri;
            var foodDatabase = await RecipesAPI.GetRecipeFromUri(itemUri);

            await Navigation.PushAsync(new RecipeDetailSaved(foodDatabase)); //calls a new recipe details page with  a new model class specific for savedfood database
        }
Esempio n. 2
0
        private async void searchRecipe_SearchButtonPressed(object sender, EventArgs e) //When searched, send the searched string by the user into the api for results and display it in the foodresults list
        {
            var searchedRecipe = searchRecipe.Text;

            foodDatabase = await RecipesAPI.GetRecipe(searchedRecipe);

            apiModel = apicontroller.GetRecipeResults(foodDatabase);
            FoodResults.ItemsSource = apiModel;
            lblDataInfo.IsVisible   = false;
        }