private async void GetMoreInfo(object sender, EventArgs e) { Button button = (Button)sender; string product_to_search = (string)button.CommandParameter; Product button_product = Products.Find(Products => Products.Item_id == product_to_search); HttpResponseMessage response = await GetProduct.GetProductPriceHistory(button_product.Item_id); if (response.IsSuccessStatusCode) { string response_content = await response.Content.ReadAsStringAsync(); List <Price> prices = JsonConvert.DeserializeObject <List <Price> >(response_content); await Navigation.PushAsync(new ProductInfoPage(button_product, prices)); } else { if (response.StatusCode == System.Net.HttpStatusCode.BadGateway) { await DisplayAlert("Try Again!", "No connection with the server", "OK"); } if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) { List <Price> prices = new List <Price>(); await Navigation.PushAsync(new ProductInfoPage(button_product, prices)); } } }