public void ShowProductDetail(Product product, int itemVerticalOffset) { var productDetails = new ProductDetailsFragment (product, itemVerticalOffset); productDetails.AddToBasket += p => { WebService.Shared.CurrentOrder.Add (p); SetupActionBar (); }; SwitchScreens (productDetails); }
async void LoadProductImage (View mainView, ProgressBar progressView, ImageView imageView, Product product) { var currentId = mainView.Id; progressView.Visibility = ViewStates.Visible; imageView.SetImageResource (Android.Resource.Color.Transparent); await Images.SetImageFromUrlAsync (imageView,product.ImageForSize (Images.ScreenWidth)); progressView.Visibility = ViewStates.Invisible; }
public void Add(Product product) { products.Insert (0,(Product)product.Clone()); var evt = ProductsChanged; if (evt != null) evt (this, EventArgs.Empty); }
public ProductDetailsFragment (Product product,int slidingDelta ) { this.slidingDelta = slidingDelta; currentProduct = product; images = product.ImageUrls.ToArray().Shuffle() ?? new string[0]; }
public bool Remove(Product product) { var result = products.Remove (product); if (result) { var evt = ProductsChanged; if (evt != null) evt (this, EventArgs.Empty); } return result; }