Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
 }