Example #1
0
 private static void Bind(this IMvxBindingContextOwner bindingOwner, object target, IMvxValueConverter converter,
                          object converterParameter, object fallbackValue, MvxBindingMode mode,
                          IMvxParsedExpression parsedTargetPath, IMvxParsedExpression parsedSourcePath)
 {
     bindingOwner.Bind(target, converter, converterParameter, fallbackValue, mode, parsedTargetPath.Print(),
                       parsedSourcePath.Print());
 }
Example #2
0
 public static void Bind <TTarget, TSource>(this IMvxBindingContextOwner bindingOwner,
                                            TTarget target,
                                            Expression <Func <TSource, object> > sourcePropertyPath,
                                            IMvxValueConverter converter = null,
                                            object converterParameter    = null,
                                            object fallbackValue         = null,
                                            MvxBindingMode mode          = MvxBindingMode.Default)
     where TTarget : class
 {
     bindingOwner.Bind(target, string.Empty, sourcePropertyPath, converter, converterParameter, fallbackValue,
                       mode);
 }
Example #3
0
        public static void Bind <TTarget, TSource>(this IMvxBindingContextOwner bindingOwner,
                                                   TTarget target,
                                                   string eventOrPropertyName,
                                                   Expression <Func <TSource, object> > sourcePropertyPath,
                                                   string converterName,
                                                   object converterParameter = null,
                                                   object fallbackValue      = null,
                                                   MvxBindingMode mode       = MvxBindingMode.Default)
            where TTarget : class
        {
            var converter = ValueConverterLookup.Find(converterName);

            bindingOwner.Bind(target, eventOrPropertyName, sourcePropertyPath, converter, converterParameter,
                              fallbackValue, mode);
        }
Example #4
0
        public static void Bind <TTarget, TSource>(this IMvxBindingContextOwner bindingOwner,
                                                   TTarget target,
                                                   Expression <Func <TTarget, object> > targetProperty,
                                                   Expression <Func <TSource, object> > sourcePropertyPath,
                                                   IMvxValueConverter converter = null,
                                                   object converterParameter    = null,
                                                   object fallbackValue         = null,
                                                   MvxBindingMode mode          = MvxBindingMode.Default)
            where TTarget : class
        {
            var parser = PropertyExpressionParser;

            var parsedTargetPath = parser.Parse(targetProperty);
            var parsedSource     = parser.Parse(sourcePropertyPath);

            bindingOwner.Bind(target, converter, converterParameter, fallbackValue, mode, parsedTargetPath, parsedSource);
        }
Example #5
0
        public static void Bind <TTarget, TSource>(this IMvxBindingContextOwner bindingOwner,
                                                   TTarget target,
                                                   string eventOrPropertyName,
                                                   Expression <Func <TSource, object> > sourcePropertyPath,
                                                   IMvxValueConverter converter = null,
                                                   object converterParameter    = null,
                                                   object fallbackValue         = null,
                                                   MvxBindingMode mode          = MvxBindingMode.Default)
            where TTarget : class
        {
            var parser       = PropertyExpressionParser;
            var parsedSource = parser.Parse(sourcePropertyPath);

            if (string.IsNullOrEmpty(eventOrPropertyName))
            {
                eventOrPropertyName = DefaultBindingNameLookup.DefaultFor(typeof(TTarget));
            }

            bindingOwner.Bind(target, converter, converterParameter, fallbackValue, mode, eventOrPropertyName,
                              parsedSource.Print());
        }