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); }
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; }