protected MvxContextWrapper(Context context, IMvxBindingContextOwner bindingContextOwner)
            : base(context)
        {
            if (bindingContextOwner == null)
                throw new InvalidOperationException("Wrapper can only be set on IMvxBindingContextOwner");

            this._bindingContextOwner = bindingContextOwner;
        }
 public static void AdaptForBinding(VisualElement element, IMvxBindingContextOwner contextOwner)
 {
     var mvxPage = element as IMvxContentPage;
     if (mvxPage != null) {
         contextOwner.BindingContext = new MvxBindingContext();
         contextOwner.BindingContext.DataContext = mvxPage.ViewModel;
     }
 }
Exemple #3
0
 public MvxFluentBindingDescription(IMvxBindingContextOwner bindingContextOwner, TTarget target)
     : base(bindingContextOwner, target)
 {
 }
Exemple #4
0
 public static MvxFluentBindingDescription <TTarget> CreateBinding <TTarget>(
     this IMvxBindingContextOwner contextOwner, TTarget target)
     where TTarget : class
 {
     return(new MvxFluentBindingDescription <TTarget>(contextOwner, target));
 }
Exemple #5
0
 public MvxInlineBindingTarget(IMvxBindingContextOwner bindingContextOwner)
 {
     BindingContextOwner = bindingContextOwner;
 }
Exemple #6
0
        /*
         * This overload removed at present - it caused confusion on iOS
         * because it could lead to the bindings being described before
         * the table cells were fully available
         * public static void DelayBind(this IMvxBindingContextOwner view, params IMvxApplicable[] applicables)
         * {
         *  view.BindingContext.DelayBind(() => applicables.Apply());
         * }
         */

        public static void DelayBind(this IMvxBindingContextOwner view, Action bindingAction)
        {
            view.BindingContext.DelayBind(bindingAction);
        }
Exemple #7
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);
        }
        public static View BindingInflate(this IMvxBindingContextOwner owner, int resourceId, ViewGroup viewGroup, bool attachToParent)
        {
            var context = (IMvxAndroidBindingContext)owner.BindingContext;

            return(context.BindingInflate(resourceId, viewGroup, attachToParent));
        }
Exemple #9
0
 public static void CreateBindingContext(this IMvxBindingContextOwner view,
                                         IEnumerable <MvxBindingDescription> bindings)
 {
     view.BindingContext = Mvx.Resolve <IMvxBindingContext>().Init(null, view, bindings);
 }
 public MvxBaseFluentBindingDescription(IMvxBindingContextOwner bindingContextOwner, TTarget target)
 {
     _bindingContextOwner = bindingContextOwner;
     _target = target;
 }
 public static void ClearBindings(this IMvxBindingContextOwner owner, object target)
 {
     owner.BindingContext.ClearBindings(target);
 }
 public static void CreateBindingContext(this IMvxBindingContextOwner view, string bindingText)
 {
     view.BindingContext = new MvxBindingContext(null, new Dictionary <object, string> {
         { view, bindingText }
     });
 }
 public static ContextWrapper Wrap(Context @base, IMvxBindingContextOwner bindingContextOwner)
 {
     return new MvxContextWrapper(@base, bindingContextOwner);
 }
 public static void CreateBindingContext(this IMvxBindingContextOwner view)
 {
     view.BindingContext = new MvxBindingContext();
 }
 public static MvxInlineBindingTarget <TViewModel> CreateInlineBindingTarget <TViewModel>(
     this IMvxBindingContextOwner bindingContextOwner)
 {
     return(new MvxInlineBindingTarget <TViewModel>(bindingContextOwner));
 }
 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);
 }
Exemple #18
0
 public static ContextWrapper Wrap(Context @base, IMvxBindingContextOwner bindingContextOwner)
 {
     return(new MvxContextWrapper(@base, bindingContextOwner));
 }
Exemple #19
0
        public static void AddLangBindings(this IMvxBindingContextOwner view, object target, string bindingText)
        {
            var bindings = Binder.LanguageBind(view.BindingContext.DataContext, target, bindingText);

            view.AddBindings(target, bindings);
        }
Exemple #20
0
 public static void CreateBindingContext(this IMvxBindingContextOwner view)
 {
     view.BindingContext = Mvx.Resolve <IMvxBindingContext>();
 }
 public static void ClearAllBindings(this IMvxBindingContextOwner owner)
 {
     owner.BindingContext.ClearAllBindings();
 }
Exemple #22
0
 public static void CreateBindingContext(this IMvxBindingContextOwner view, string bindingText)
 {
     view.BindingContext = Mvx.Resolve <IMvxBindingContext>().Init(null, view, bindingText);
 }