public ProductDetailViewController(Product product)
		{
			CurrentProduct = product;

			Title = CurrentProduct.Name;
			LoadProductData();
			TableView.TableFooterView = new UIView(new RectangleF(0, 0, 0, BottomButtonView.Height));

			View.AddSubview(BottomView = new BottomButtonView()
			{
				ButtonText = "Add to Basket",
				Button =
				{
					Image = (tshirtIcon = UIImage.FromBundle("t-shirt")),
				},
				ButtonTapped = async () => await addToBasket()
			});
		}
Beispiel #2
0
 public void Add(Product product)
 {
     _products.Insert(0, (Product)product.Clone());
     var evt = ProductsChanged;
     if (evt != null)
         evt(this, EventArgs.Empty);
 }
Beispiel #3
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;
 }
 public void ShowProductDetail(Product product)
 {
     var productDetails = new ProductDetailViewController(product);
     productDetails.AddToBasket += p =>
     {
         WebService.Shared.CurrentOrder.Add(p);
         UpdateProductsCount();
     };
     navigation.PushViewController(productDetails, true);
 }
 public async Task Update(Product product)
 {
     NameLabel.Text = product.Name;
     SizeLabel.Text = product.Size.Description;
     ColorLabel.Text = product.Color.Name;
     PriceLabel.Text = product.PriceDescription;
     var imageTask = FileCache.Download(product.ImageForSize(320));
     if (!imageTask.IsCompleted)
         //Put default before doing the web request;
         ImageView.Image = Image.Value;
     var image = await imageTask;
     ImageView.Image = UIImage.FromFile(image);
 }
        public void ShowProductDetail(Product product, int itemVerticalOffset)
        {
            var productDetails = new ProductDetailsFragment(product, itemVerticalOffset);

            productDetails.AddToBasket += p =>
            {
                WebService.Shared.CurrentOrder.Add(p);

                SetupActionBar();
            };

            SwitchScreens(productDetails);
        }
 public ProductDetailsFragment(Product product, int slidingDelta)
 {
     this.slidingDelta = slidingDelta;
     currentProduct = product;
     images = product.ImageUrls.ToArray().Shuffle() ?? new string[0];
 }
 async void LoadProductImage(View mainView, ProgressBar progressView, ImageView imageView, Product product)
 {
     progressView.Visibility = ViewStates.Visible;
     imageView.SetImageResource(Android.Resource.Color.Transparent);
     await Images.SetImageFromUrlAsync(imageView, product.ImageForSize(Images.ScreenWidth));
     progressView.Visibility = ViewStates.Invisible;
 }
 public ProductDescriptionView(Product product)
     : this()
 {
     this.Update(product);
 }
 public void Update(Product product)
 {
     Name.Text = product.Name;
     DescriptionLabel.Text = product.Description;
     Price.Text = product.PriceDescription;
 }