Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 protected virtual string GetSelectedSizeUrl(SfImage image)
 {
     return(SfImageHelper.GetSelectedSizeUrl(image));
 }