public virtual MultiCardViewModel GetViewModel() { var viewModel = new MultiCardViewModel() { GroupHeader = this.GroupHeader, BackgroundColor = this.BackgroundColor, GroupActionName = this.PrimaryActionName, GroupActionUrl = SfPagesHelper.GetLinkedUrl(this.LinkedPageId, this.LinkedUrl, this.IsPageSelectMode), Cards = this.Cards.Select(c => c.ToViewModel()).ToList(), CssClass = this.CssClass }; SfImage image; if (this.ImageId != Guid.Empty) { image = SfImageHelper.GetImage(this.ImageId, this.ImageProviderName);; if (image != null) { viewModel.SelectedSizeUrl = SfImageHelper.GetSelectedSizeUrl(image); viewModel.ImageAlternativeText = image.AlternativeText; viewModel.ImageTitle = image.Title; } } return(viewModel); }
public CardDetailsView ToViewModel() { var cardDetailsView = new CardDetailsView { Heading = this.Heading, Description = this.Description, ActionName = this.ActionName, ActionUrl = "#"//SfPagesHelper.GetLinkedUrl(this.LinkedPageId, this.LinkedUrl, this.IsPageSelectMode) }; SfImage image; if (this.ImageId != Guid.Empty) { image = SfImageHelper.GetImage(this.ImageId, this.ImageProviderName);; if (image != null) { cardDetailsView.SelectedSizeUrl = SfImageHelper.GetSelectedSizeUrl(image); cardDetailsView.ImageAlternativeText = image.AlternativeText; cardDetailsView.ImageTitle = image.Title; } } return(cardDetailsView); }
protected virtual SfImage GetImage() { return(SfImageHelper.GetImage(this.ImageId, this.ImageProviderName)); }