Esempio n. 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);
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
        }
Esempio n. 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);
		}
Esempio n. 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);
		}