public static T Bind <T>(this T element, InlineBindingTarget target, string targetPath, string sourcePath, IValueConverter converter = null, object converterParameter = null, object fallbackValue = null, BindingMode mode = BindingMode.Default) { if (string.IsNullOrEmpty(targetPath)) { targetPath = BindingSingletonCache.Instance.DefaultBindingNameLookup.DefaultFor(typeof(T)); } var bindingDescription = new BindingDescription( targetPath, sourcePath, converter, converterParameter, fallbackValue, mode); target.BindingContextOwner.AddBinding(element, bindingDescription); return(element); }
public static T Bind <T, TViewModel>(this T element, InlineBindingTarget target, Expression <Func <TViewModel, object> > sourcePropertyPath, IValueConverter converter, object converterParameter = null, object fallbackValue = null, BindingMode mode = BindingMode.Default) { return(element.Bind(target, null, sourcePropertyPath, converter, converterParameter, fallbackValue, mode)); }
public static T Bind <T, TViewModel>(this T element, InlineBindingTarget target, Expression <Func <T, object> > targetPropertyPath, Expression <Func <TViewModel, object> > sourcePropertyPath, string converterName = null, object converterParameter = null, object fallbackValue = null, BindingMode mode = BindingMode.Default) { var converter = BindingSingletonCache.Instance.ValueConverterLookup.Find(converterName); return(element.Bind(target, targetPropertyPath, sourcePropertyPath, converter, converterParameter, fallbackValue, mode)); }
public static T Bind <T, TViewModel>(this T element, InlineBindingTarget target, Expression <Func <T, object> > targetPropertyPath, Expression <Func <TViewModel, object> > sourcePropertyPath, IValueConverter converter, object converterParameter = null, object fallbackValue = null, BindingMode mode = BindingMode.Default) { var parser = BindingSingletonCache.Instance.PropertyExpressionParser; var sourcePath = parser.Parse(sourcePropertyPath).Print(); var targetPath = targetPropertyPath == null ? null : parser.Parse(targetPropertyPath).Print(); return(element.Bind(target, targetPath, sourcePath, converter, converterParameter, fallbackValue, mode)); }
public static T Bind <T>(this T element, InlineBindingTarget target, string descriptionText) { target.BindingContextOwner.AddBindings(element, descriptionText); return(element); }