Untitled

 avatar
unknown
plain_text
3 years ago
797 B
5
Indexable
namespace ClientiBaseline.Core.ViewModels.Components
{
    public sealed class ServiceSectionViewModel : ComponentBaseViewModel
    {
        public ServiceSectionViewModel(BlockListItem item) : base(item)
        {
            var serviceSection = item.GetPublishedModelFromBlockItem<ServiceSectionViewModel>();

            if (serviceSection != null)
            {
                Text = serviceSection.Text;
                HasText = !string.IsNullOrEmpty(serviceSection?.ToString());
            }

            Link = serviceSection.Link;
            HasLink = !string.IsNullOrEmpty(Link?.Url);
        }

        public IHtmlEncodedString Text { get; }
        public bool HasText { get; }
        public Link Link { get; }
        public bool HasLink { get; }
    }
}
Editor is loading...