public static void SetBinding <TSource>(this BindableObject self, BindableProperty targetProperty, Expression <Func <TSource, object> > sourceProperty, BindingMode mode = BindingMode.Default, IValueConverter converter = null, string stringFormat = null) { if (self == null) { throw new ArgumentNullException("self"); } if (targetProperty == null) { throw new ArgumentNullException("targetProperty"); } if (sourceProperty == null) { throw new ArgumentNullException("sourceProperty"); } Binding binding = Binding.Create(sourceProperty, mode, converter, stringFormat: stringFormat); self.SetBinding(targetProperty, binding); }
// public CCFStyleKit StyleKit { get { return App.Current.StyleKit; } } public static Binding CreateBinding(Expression <Func <T, object> > propertyGetter, BindingMode mode = BindingMode.Default, IValueConverter converter = null, object converterParameter = null, string stringFormat = null) { return(Binding.Create(propertyGetter, mode, converter, converterParameter, stringFormat)); }