Exemple #1
0
        /// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new TextFieldViewModel()
            {
                Value                = value as string ?? this.MetaField.DefaultValue ?? string.Empty,
                MetaField            = metaField,
                ValidationAttributes = this.BuildValidationAttributes(),
                CssClass             = this.CssClass,
                ValidatorDefinition  = this.ValidatorDefinition,
                PlaceholderText      = this.PlaceholderText,
                InputType            = this.InputType
            };

            return(viewModel);
        }
        /// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new TextFieldViewModel()
            {
                Value                = value as string ?? this.MetaField.DefaultValue ?? string.Empty,
                MetaField            = metaField,
                ValidationAttributes = this.BuildValidationAttributes(),
                CssClass             = this.CssClass,
                ValidatorDefinition  = this.BuildValidatorDefinition(this.ValidatorDefinition, metaField.Title),
                PlaceholderText      = this.PlaceholderText,
                InputType            = this.InputType,
                Hidden               = this.Hidden && (!Sitefinity.Services.SystemManager.IsDesignMode || Sitefinity.Services.SystemManager.IsPreviewMode)
            };

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

            return viewModel;
        }