async void OnOrderButtonClick(object sender, EventArgs args) { var orderSum = orderedProducts.Sum((a) => a.Amount * a.Price); var message = "Are you sure to order for " + string.Format("{0:0.00}", orderSum) + " CHF?"; var orderConfirmed = await DisplayAlert("Buy products?", message, "Yes", "No"); if (orderConfirmed) { var customerPosition = await PositionHelper.GetPositionOrNull(this); var response = await App.Rest.CreateOrder(orderedProducts, customerPosition); if (response != null) { Debug.WriteLine("Created order with id {0}", response.Id); await Navigation.PushModalAsync(new OrderConfirmPage(response)); } } }