public static FormGroup <MvcBootstrapHelper <TModel> > FormGroup <TModel, TValue>(this IFormGroupCreator <MvcBootstrapHelper <TModel> > creator, Expression <Func <TModel, TValue> > labelExpression) { FormGroup <MvcBootstrapHelper <TModel> > formGroup = new FormGroup <MvcBootstrapHelper <TModel> >(creator); formGroup.ControlLabel = formGroup.GetWrapper().ControlLabel(labelExpression); return(formGroup); }
// FormGroup public static FormGroup <THelper> FormGroup <THelper>(this IFormGroupCreator <THelper> creator, string label = null, string labelFor = null) where THelper : BootstrapHelper <THelper> { FormGroup <THelper> formGroup = new FormGroup <THelper>(creator); if (label != null) { formGroup.ControlLabel = formGroup.GetWrapper().ControlLabel(label, labelFor); } return(formGroup); }
public static FormGroup <THelper> SetGroupLabel <THelper, TThis>(this FormGroup <THelper> formGroup, string label, string labelFor = null, Action <ControlLabel <THelper> > labelAction = null) where THelper : BootstrapHelper <THelper> { if (label != null) { ControlLabel <THelper> controlLabel = new ControlLabel <THelper>(formGroup.Helper, label).For(labelFor); formGroup.ControlLabel = formGroup.GetWrapper().ControlLabel(label, labelFor); if (labelAction != null) { labelAction(controlLabel); } } return(formGroup); }