private static KnockoutBindingComplexItem CreateDatePickerComplexBindingItem <TModel>(Expression <Func <TModel, object> > expression, IDatePickerConfig config) { var complexBinding = new KnockoutBindingComplexItem { Name = "datepicker" }; complexBinding.Add(new KnockoutBindingItem <TModel, object> { Name = "value", Expression = expression }); complexBinding.Add(new KnockoutBindingStringItem("options", JsonConvert.SerializeObject(config), false)); return(complexBinding); }
public static KnockoutBinding <TModel> DatePicker <TModel>(this KnockoutBinding <TModel> binding, Expression <Func <TModel, object> > expression, IDatePickerConfig config) { binding.Items.Add(CreateDatePickerComplexBindingItem(expression, config)); return(binding); }