Пример #1
0
 private static void UpdataContext(View parent, View view, IBindingContext context)
 {
     if (view == null)
     {
         return;
     }
     if (parent == null)
     {
         parent = GetParent(view);
     }
     if (parent != null && !Equals(BindingServiceProvider.ContextManager.GetBindingContext(parent).Value, context.Value))
     {
         ContentMember.SetValue(parent, new[] { context.Value, AddViewValue });
     }
 }
Пример #2
0
            public void OnChildViewRemoved(View parent, View child)
            {
                var viewGroup = (ViewGroup)parent;

                if (viewGroup.ChildCount == 0 || viewGroup.GetChildAt(0) == child)
                {
                    var underlyingView = GetUnderlyingView(child);
                    if (underlyingView != null)
                    {
                        BindingServiceProvider.ContextManager.GetBindingContext(underlyingView).ValueChanged -= BindingContextChangedDelegate;
                    }
                    ContentMember.SetValue(viewGroup, RemoveViewValue);
                }
                GlobalViewParentListener.Instance.OnChildViewRemoved(parent, child);
            }