void ReleaseDesignerOutlets() { if (BuyButton != null) { BuyButton.Dispose(); BuyButton = null; } if (ItemDescriptionLabel != null) { ItemDescriptionLabel.Dispose(); ItemDescriptionLabel = null; } if (ItemImageView != null) { ItemImageView.Dispose(); ItemImageView = null; } if (ItemPriceLabel != null) { ItemPriceLabel.Dispose(); ItemPriceLabel = null; } if (ItemTitleLabel != null) { ItemTitleLabel.Dispose(); ItemTitleLabel = null; } }
void ReleaseDesignerOutlets() { if (ItemDescriptionLabel != null) { ItemDescriptionLabel.Dispose(); ItemDescriptionLabel = null; } if (ItemImageView != null) { ItemImageView.Dispose(); ItemImageView = null; } if (ItemNameLabel != null) { ItemNameLabel.Dispose(); ItemNameLabel = null; } if (ItemPriceLabel != null) { ItemPriceLabel.Dispose(); ItemPriceLabel = null; } }
public void InitViews(string text) { ItemNameLabel.Text = text; SDImageCache.SharedImageCache.Config.ShouldCacheImagesInMemory = false; SDImageCache.SharedImageCache.ClearMemory(); ItemImageView.SetImage(new NSUrl("https://picsum.photos/200/200")); }
void ReleaseDesignerOutlets() { if (OverlayView != null) { OverlayView.Dispose(); OverlayView = null; } if (BadgeView != null) { BadgeView.Dispose(); BadgeView = null; } if (BadgeLabel != null) { BadgeLabel.Dispose(); BadgeLabel = null; } if (AmountLabel != null) { AmountLabel.Dispose(); AmountLabel = null; } if (ItemImageView != null) { ItemImageView.Dispose(); ItemImageView = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (TotalPriceLabel != null) { TotalPriceLabel.Dispose(); TotalPriceLabel = null; } }
public async void Bind(SaleItem saleItem) { await ItemImageView.BindImageViewAsync(saleItem); ItemNameLabel.Text = !string.IsNullOrEmpty(saleItem.Name) ? saleItem.Name.ToUpperInvariant() : string.Empty; ItemDescriptionLabel.Text = saleItem.Description; var smallAttributes = new UIStringAttributes { Font = UIFont.FromName(ItemPriceLabel.Font.Name, 10f) }; string priceStr = "$" + Math.Round(saleItem.Price); NSMutableAttributedString mutablePriceStr = new NSMutableAttributedString(priceStr); mutablePriceStr.SetAttributes(smallAttributes.Dictionary, new NSRange(0, 1)); ItemPriceLabel.AttributedText = mutablePriceStr; ItemId = saleItem.Id; }
private async void LoadData() { await ItemImageView.BindImageViewAsync(Product); ItemTitleLabel.Text = (Product.Name ?? string.Empty).ToUpper(); ItemDescriptionLabel.Text = Product.Description; var smallAttributes = new UIStringAttributes { Font = UIFont.FromName(ItemPriceLabel.Font.Name, 20f) }; string priceStr = "SEK" + Product.Price.ToString("0.00"); NSMutableAttributedString mutablePriceStr = new NSMutableAttributedString(priceStr); mutablePriceStr.SetAttributes(smallAttributes.Dictionary, new NSRange(0, 3)); mutablePriceStr.SetAttributes(smallAttributes.Dictionary, new NSRange(priceStr.Length - 3, 3)); ItemPriceLabel.AttributedText = mutablePriceStr; }
public async void Bind(Product Product) { await ItemImageView.BindImageViewAsync(Product); ItemSupplierLabel.Text = !string.IsNullOrEmpty(Product.Supplier.Name) ? Product.Supplier.Name.ToUpperInvariant() : string.Empty; ItemNameLabel.Text = !string.IsNullOrEmpty(Product.Name) ? Product.Name.ToUpperInvariant() : string.Empty; ItemDescriptionLabel.Text = !string.IsNullOrEmpty(Product.Description) ? Product.Description : "Beskrivning saknas"; //var smallAttributes = new UIStringAttributes //{ // Font = UIFont.FromName(ItemPriceLabel.Font.Name, 10f) //}; //string priceStr = "$" + Math.Round(Product.Price); //NSMutableAttributedString mutablePriceStr = new NSMutableAttributedString(priceStr); //mutablePriceStr.SetAttributes(smallAttributes.Dictionary, new NSRange(0, 1)); //ItemPriceLabel.AttributedText = mutablePriceStr; ItemId = Product.Id; }