// 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); }
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); } }
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); } }
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); } }
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); }
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); }
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); }