Beispiel #1
0
        public static void AddBindings(this IMvxBindingContextOwner view, object target,
                                       IEnumerable <MvxBindingDescription> bindingDescriptions)
        {
            var binder = Mvx.Resolve <IMvxBinder>();

            view.AddBindings(binder.Bind(view.BindingContext.DataContext, target, bindingDescriptions));
        }
Beispiel #2
0
        public static void AddBinding(this IMvxBindingContextOwner view, object target,
                                      MvxBindingDescription bindingDescription, object clearKey = null)
        {
            var descriptions = new[] { bindingDescription };

            view.AddBindings(target, descriptions, clearKey);
        }
Beispiel #3
0
        /*
         *      public static void AddBindings(this IMvxBindingContextOwner view, object bindingObject)
         * {
         *  view.AddBindings(view.DataContext, bindingObject);
         * }
         *
         *      public static void AddBindings(this IMvxBindingContextOwner view, object source, object bindingObject)
         * {
         *  var bindingMap = bindingObject.ToSimplePropertyDictionary();
         *  view.AddBindings(source, bindingMap);
         * }
         */

        public static void AddBindings(this IMvxBindingContextOwner view,
                                       IDictionary <object, string> bindingMap)
        {
            foreach (var kvp in bindingMap)
            {
                var candidatePropertyName = kvp.Key as string;
                if (candidatePropertyName == null)
                {
                    view.AddBindings(kvp.Key, kvp.Value);
                }
                else
                {
                    view.AddBindings(candidatePropertyName, kvp.Value);
                }
            }
        }
Beispiel #4
0
        public static void AddBindings(this IMvxBindingContextOwner view, object target,
                                       IEnumerable <MvxBindingDescription> bindingDescriptions, object clearKey = null)
        {
            var bindings = Binder.Bind(view.BindingContext.DataContext, target, bindingDescriptions);

            view.AddBindings(target, bindings, clearKey);
        }
Beispiel #5
0
 public static void AddBindings(this IMvxBindingContextOwner view,
                                IDictionary <string, string> bindingMap)
 {
     foreach (var kvp in bindingMap)
     {
         view.AddBindings(kvp.Key, kvp.Value);
     }
 }
Beispiel #6
0
        public static void AddBindings(this IMvxBindingContextOwner view, string targetPropertyName,
                                       string bindingText)
        {
            object target;

            if (!view.TryGetPropertyValue(targetPropertyName, out target))
            {
                return;
            }

            view.AddBindings(target, bindingText);
        }
Beispiel #7
0
        public static void AddBindings(this IMvxBindingContextOwner view, string targetPropertyName,
                                       IEnumerable <MvxBindingDescription> bindingDescriptions)
        {
            object target;

            if (!view.TryGetPropertyValue(targetPropertyName, out target))
            {
                return;
            }

            view.AddBindings(target, bindingDescriptions);
        }
Beispiel #8
0
        public static void AddBindings(this IMvxBindingContextOwner view,
                                       IDictionary <object, IEnumerable <MvxBindingDescription> > bindingMap)
        {
            if (bindingMap == null)
            {
                return;
            }

            foreach (var kvp in bindingMap)
            {
                var candidatePropertyName = kvp.Key as string;
                if (candidatePropertyName == null)
                {
                    view.AddBindings(kvp.Key, kvp.Value);
                }
                else
                {
                    view.AddBindings(candidatePropertyName, kvp.Value);
                }
            }
        }
Beispiel #9
0
        public static void AddBindings(this IMvxBindingContextOwner view,
                                       IDictionary <object, IEnumerable <MvxBindingDescription> > bindingMap)
        {
            if (bindingMap == null)
            {
                return;
            }

            foreach (var kvp in bindingMap)
            {
                view.AddBindings(kvp.Key, kvp.Value);
            }
        }
Beispiel #10
0
        public static void AddBindings(this IMvxBindingContextOwner view,
                                       IDictionary <object, string> bindingMap,
                                       object clearKey = null)
        {
            if (bindingMap == null)
            {
                return;
            }

            foreach (var kvp in bindingMap)
            {
                view.AddBindings(kvp.Key, kvp.Value, clearKey);
            }
        }
Beispiel #11
0
        public static void AddBindings(this IMvxBindingContextOwner view, object target, string bindingText)
        {
            var binder = Mvx.Resolve <IMvxBinder>();

            view.AddBindings(binder.Bind(view.BindingContext.DataContext, target, bindingText));
        }
Beispiel #12
0
        public static void AddBindings(this IMvxBindingContextOwner view, object target, string bindingText, object clearKey = null)
        {
            var bindings = Binder.Bind(view.BindingContext.DataContext, target, bindingText);

            view.AddBindings(target, bindings, clearKey);
        }
Beispiel #13
0
        public static void AddLangBindings(this IMvxBindingContextOwner view, object target, string bindingText)
        {
            var bindings = Binder.LanguageBind(view.BindingContext.DataContext, target, bindingText);

            view.AddBindings(bindings);
        }
 public static T Bind <T>(this T element, IMvxBindingContextOwner bindingContextOwner,
                          IEnumerable <MvxBindingDescription> descriptions)
 {
     bindingContextOwner.AddBindings(element, descriptions);
     return(element);
 }
 public static T Bind <T>(this T element, IMvxBindingContextOwner bindingContextOwner, string descriptionText)
 {
     bindingContextOwner.AddBindings(element, descriptionText);
     return(element);
 }