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