Esempio n. 1
0
 protected async Task ShowAddToCartAsync()
 {
     await Application.Current.MainPage.DisplayAlert(
         RecommendedProducts.First().Name,
         Resources.Alert_Added_To_Cart,
         Resources.Alert_OK);
 }
        protected async Task AddProductToCartAsync()
        {
            var product = RecommendedProducts.First();

            if (product != null)
            {
                await TryExecuteWithLoadingIndicatorsAsync(
                    RestPoolService.ProductCartAPI.AddProductAsync(product));

                await Application.Current.MainPage.DisplayAlert(
                    product.Name,
                    Resources.Alert_Added_To_Cart,
                    Resources.Alert_OK);
            }
            else
            {
                XSnackService.ShowMessage(Resources.Snack_Message_AddedToCart_Error);
            }
        }