Example #1
0
        static void BindingContextPropertyBindingChanging(BindableObject bindable, BindingBase oldBindingBase, BindingBase newBindingBase)
        {
            object context    = bindable._inheritedContext;
            var    oldBinding = oldBindingBase as Binding;
            var    newBinding = newBindingBase as Binding;

            if (context == null && oldBinding != null)
            {
                context = oldBinding.Context;
            }
            if (context != null && newBinding != null)
            {
                newBinding.Context = context;
            }
        }
 public static BindingMode GetRealizedMode(this BindingBase self, BindableProperty property)
 {
     return(self.Mode != BindingMode.Default ? self.Mode : property.DefaultBindingMode);
 }
Example #3
0
 /// <summary>
 /// Assigns a binding to a property.
 /// </summary>
 /// <param name="targetProperty">The BindableProperty on which to set a binding.</param>
 /// <param name="binding">The binding to set.</param>
 public void SetBinding(BindableProperty targetProperty, BindingBase binding)
 {
     SetBinding(targetProperty, binding, false);
 }