示例#1
0
        // From internal Platform class
        internal static void DisposeModelAndChildrenRenderers(XF.Element view)
        {
            IVisualElementRenderer renderer;

            foreach (XF.VisualElement child in view.Descendants())
            {
                renderer = Platform.GetRenderer(child);
                child.ClearValue(RendererProperty);

                if (renderer != null)
                {
                    renderer.View.RemoveFromParent();
                    renderer.Dispose();
                }
            }

            renderer = Platform.GetRenderer((XF.VisualElement)view);
            if (renderer != null)
            {
                renderer.View.RemoveFromParent();
                renderer.Dispose();
            }

            view.ClearValue(RendererProperty);
        }
示例#2
0
        protected virtual void OnChildRemoved(Element child)
        {
            child.Parent = null;

            ChildRemoved?.Invoke(child, new ElementEventArgs(child));

            OnDescendantRemoved(child);
            foreach (Element element in child.Descendants())
            {
                OnDescendantRemoved(element);
            }
        }
示例#3
0
        protected virtual void OnChildAdded(Element child)
        {
            child.Parent = this;

            child.ApplyBindings(skipBindingContext: false, fromBindingContextChanged: true);

            ChildAdded?.Invoke(this, new ElementEventArgs(child));

            OnDescendantAdded(child);
            foreach (Element element in child.Descendants())
            {
                OnDescendantAdded(element);
            }
        }
示例#4
0
        protected virtual void OnChildAdded(Element child)
        {
            child.Parent = this;
            if (Platform != null)
            {
                child.Platform = Platform;
            }

            child.ApplyBindings();

            if (ChildAdded != null)
            {
                ChildAdded(this, new ElementEventArgs(child));
            }

            OnDescendantAdded(child);
            foreach (Element element in child.Descendants())
            {
                OnDescendantAdded(element);
            }
        }
示例#5
0
        void DisposeModelAndChildrenRenderers(Xamarin.Forms.Element view)
        {
            IVisualElementRenderer renderer;

            foreach (VisualElement child in view.Descendants())
            {
                renderer = GetRenderer(child);
                child.ClearValue(RendererProperty);

                if (renderer != null)
                {
                    renderer.Dispose();
                }
            }

            renderer = GetRenderer((VisualElement)view);
            if (renderer != null)
            {
                renderer.Dispose();
            }

            view.ClearValue(RendererProperty);
        }
示例#6
0
		protected virtual void OnChildRemoved(Element child)
		{
			child.Parent = null;

			if (ChildRemoved != null)
				ChildRemoved(child, new ElementEventArgs(child));

			OnDescendantRemoved(child);
			foreach (Element element in child.Descendants())
				OnDescendantRemoved(element);
		}
示例#7
0
		protected virtual void OnChildAdded(Element child)
		{
			child.Parent = this;
			if (Platform != null)
				child.Platform = Platform;

			child.ApplyBindings();

			if (ChildAdded != null)
				ChildAdded(this, new ElementEventArgs(child));

			OnDescendantAdded(child);
			foreach (Element element in child.Descendants())
				OnDescendantAdded(element);
		}