ChameleonForms/Component/Field.cs
/// <summary>
/// Creates a single form field as a child of another form field.
/// </summary>
/// <example>
/// @using (var f = s.BeginFieldFor(m => m.Company)) {
///     @f.FieldFor(m => m.PositionTitle)
/// }
/// </example>
/// <typeparam name="TModel">The view model type for the current view</typeparam>
/// <typeparam name="TTemplate">The type of HTML template renderer the form is using</typeparam>
/// <typeparam name="T">The type of the field being generated</typeparam>
/// <param name="field">The parent field the field is being created in</param>
/// <param name="property">A lamdba expression to identify the field to render the field for</param>
/// <returns>A field configuration object that allows you to configure the field</returns>
Creates a single form field as a child of another form field.
Creates a single form field as a child of another form field .
public static IFieldConfiguration FieldFor<TModel, TTemplate, T>(this Field<TModel, TTemplate> field, Expression<Func<TModel, T>> property) where TTemplate : IFormTemplate
        {
            var config = new FieldConfiguration();
            new Field<TModel, TTemplate>(field.Form, false, field.Form.GetFieldGenerator(property), config);
            return config;
        }
public static IFieldConfiguration FieldFor < TModel , TTemplate , T > ( this Field < TModel , TTemplate > field , Expression < Func < TModel , T > > property ) where TTemplate : IFormTemplate { var config = new FieldConfiguration ( ) ; new Field < TModel , TTemplate > ( field . Form , false , field . Form . GetFieldGenerator ( property ) , config ) ; return config ; }
Creates a single form field as a child of another form field.
Creates a single form field as a child of another form field .
// ReSharper disable ObjectCreationAsStatement // ReSharper restore ObjectCreationAsStatement
A field configuration object that allows you to configure the field
A field configuration object that allows you to configure the field
Field<TModel, TTemplate>
this
property
Expression<Func<TModel, T>>
A lamdba expression to identify the field to render the field for
A lamdba expression to identify the field to render the field for
field
The parent field the field is being created in
The parent field the field is being created in
example
None
typeparam
The view model type for the current view
The view model type for the current view
typeparam
The type of HTML template renderer the form is using
The type of HTML template renderer the form is using
typeparam
The type of the field being generated
The type of the field being generated