public CatalogItemVM(Product model) { Model = model; Id = model.Id; if (!model.ImageUrls.IsNullOrEmpty()) { var image = model.ImageUrls.First(); ImageUrl = image.SmallUrl; } Name = model.Name; Price = model.Price; UnitName = model.UnitName; MaxPrice = model.MaxPrice; OldPrice = model.OldPrice; UnitNameOld = model.UnitNameOld; if (!model.Badges.IsNullOrEmpty()) { Badges = model.Badges.Select(SetupBadgeItem).ToList(); } Marked = model.IsMarked; StateName = model.State?.Name; MarkEnabled = ConfigService.Config.MarkedEnabled; BasketBlockViewModel = VmService.LoadItemBasketVm(); if (BasketBlockViewModel is IMvxViewModel <IMvxBundle> parameterVM) { parameterVM.Prepare(new ProductCardBundle(Model, Base.Core.Models.Navigation.NavigationType.InsideScreen)); } else { BasketBlockViewModel?.Init(new ProductCardBundle(Model, Base.Core.Models.Navigation.NavigationType.InsideScreen)); } }