コード例 #1
0
 public static DataBindBuilder <TModel> Click <TModel>(this DataBindBuilder <TModel> @this, string bindingProperty)
 {
     return(@this.Custom("click", bindingProperty));
 }
コード例 #2
0
 /// <summary>
 /// Bind a radio button to a particular view model property
 /// <para>&#160;</para>
 /// <para>Usage Example:</para>
 /// <para> &lt;input type="radio" @helper.DataBind(db => db.Checked(x => x.Gender, Gender.Male)) /&gt;</para>
 /// <para>&#160;</para>
 /// <para>Result:</para>
 /// <para> &lt;input type="radio" value="Male" data-bind="checked: Gender"  /&gt;</para>
 /// <para>&#160;</para>
 /// </summary>
 /// <typeparam name="TModel"></typeparam>
 /// <typeparam name="TValue"> </typeparam>
 /// <param name="this"></param>
 /// <param name="bindingProperty"></param>
 /// <param name="value"> </param>
 /// <returns></returns>
 public static DataBindBuilder <TModel> Checked <TModel, TValue>(this DataBindBuilder <TModel> @this, Expression <Func <TModel, TValue> > bindingProperty, object value)
 {
     @this.Builder.Attr("value", value.ToString());
     return(@this.Custom("checked", bindingProperty));
 }
コード例 #3
0
 /// <summary>
 /// Bind a checkbox to a *boolean* view model property
 /// <para>&#160;</para>
 /// <para>Usage Example:</para>
 /// <para> &lt;input type="checkbox" @helper.DataBind(db => db.Checked(x => x.IsCool)) /&gt;</para>
 /// <para>&#160;</para>
 /// <para>Result:</para>
 /// <para> &lt;input type="checkbox" data-bind="checked: IsCool" /&gt;</para>
 /// <para>&#160;</para>
 /// </summary>
 /// <typeparam name="TModel"></typeparam>
 /// <param name="this"></param>
 /// <param name="bindingProperty"></param>
 /// <returns></returns>
 public static DataBindBuilder <TModel> Checked <TModel>(this DataBindBuilder <TModel> @this, Expression <Func <TModel, bool> > bindingProperty)
 {
     return(@this.Custom("checked", bindingProperty));
 }
コード例 #4
0
 public static DataBindBuilder <TModel> Visible <TModel>(this DataBindBuilder <TModel> @this, string bindingProperty)
 {
     return(@this.Custom("visible", bindingProperty));
 }
コード例 #5
0
 public static DataBindBuilder <TModel> Visible <TModel>(this DataBindBuilder <TModel> @this, Expression <Func <TModel, bool> > bindingProperty)
 {
     return(@this.Custom("visible", bindingProperty));
 }
コード例 #6
0
 public static DataBindBuilder <TModel> If <TModel, TValue>(this DataBindBuilder <TModel> @this, Expression <Func <TModel, TValue> > bindingProperty)
 {
     return(@this.Custom("if", bindingProperty));
 }