using Avalonia.Media; using Avalonia.Media.Imaging; using demo_trade.Models; using System.Threading.Tasks; namespace demo_trade.UI.Presenters { public class ProductPresenter { public string ArticleNumber { get; set; } public string Name { get; set; } public string Description { get; set; } public decimal Cost { get; set; } public short? DiscountAmount { get; set; } public int? QuantityInStock { get; set; } public string Image { get; set; } public int? ProductMaxDiscount { get; set; } public decimal? CostWithDiscount { get => Cost - (Cost * DiscountAmount / 100); } public Manufacturer Manufacturer { get; set; } public SolidColorBrush ColorBackgroundItem { get => DiscountAmount < 15 ? new SolidColorBrush(Color.FromRgb(255, 255, 255)) : new SolidColorBrush(Color.FromRgb(255, 245, 0)); } } }