/// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new ParagraphTextFieldViewModel()
            {
                Value = value as string ?? this.MetaField.DefaultValue ?? string.Empty,
                MetaField = this.MetaField,
                PlaceholderText = this.PlaceholderText,
                ValidationAttributes = this.BuildValidationAttributesString(),
                RequiredViolationMessage = this.ValidatorDefinition.RequiredViolationMessage,
                MaxLengthViolationMessage = this.ValidatorDefinition.MaxLengthViolationMessage,
                CssClass = this.CssClass
            };

            return viewModel;
        }
        /// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new ParagraphTextFieldViewModel()
            {
                Value = value as string ?? this.MetaField.DefaultValue ?? string.Empty,
                MetaField = this.MetaField,
                PlaceholderText = this.PlaceholderText,
                ValidationAttributes = this.BuildValidationAttributesString(),
                RequiredViolationMessage = this.ValidatorDefinition.RequiredViolationMessage,
                MaxLengthViolationMessage = this.ValidatorDefinition.MaxLengthViolationMessage,
                CssClass = this.CssClass
            };

            return viewModel;
        }
Exemple #3
0
        /// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new ParagraphTextFieldViewModel()
            {
                Value                     = value as string ?? this.MetaField.DefaultValue ?? string.Empty,
                MetaField                 = this.MetaField,
                PlaceholderText           = this.PlaceholderText,
                ValidationAttributes      = this.BuildValidationAttributesString(),
                RequiredViolationMessage  = this.ValidatorDefinition.RequiredViolationMessage,
                MaxLengthViolationMessage = this.ValidatorDefinition.MaxLengthViolationMessage,
                CssClass                  = this.CssClass,
                Hidden                    = this.Hidden && (!Sitefinity.Services.SystemManager.IsDesignMode || Sitefinity.Services.SystemManager.IsPreviewMode)
            };

            return(viewModel);
        }