public static void SetInheritedBindingContext(BindableObject bindable, object value)
        {
            BindablePropertyContext bpContext = bindable.GetContext(BindingContextProperty);

            if (bpContext != null && ((bpContext.Attributes & BindableContextAttributes.IsManuallySet) != 0))
            {
                return;
            }

            object oldContext = bindable._inheritedContext;

            if (ReferenceEquals(oldContext, value))
            {
                return;
            }

            if (bpContext != null && oldContext == null)
            {
                oldContext = bpContext.Value;
            }

            if (bpContext != null && bpContext.Binding != null)
            {
                bpContext.Binding.Context  = value;
                bindable._inheritedContext = null;
            }
            else
            {
                bindable._inheritedContext = value;
            }

            bindable.ApplyBindings(skipBindingContext: false, fromBindingContextChanged: true);
            bindable.OnBindingContextChanged();
        }
 static void BindingContextPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
 {
     bindable._inheritedContext = null;
     bindable.ApplyBindings(skipBindingContext: true, fromBindingContextChanged: true);
     bindable.OnBindingContextChanged();
 }