Пример #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && _insetTracker != null)
            {
                _insetTracker.Dispose();
                _insetTracker = null;

                var viewsToLookAt = new Stack <UIView>(Subviews);
                while (viewsToLookAt.Count > 0)
                {
                    var view             = viewsToLookAt.Pop();
                    var viewCellRenderer = view as ViewCellRenderer.ViewTableCell;
                    if (viewCellRenderer != null)
                    {
                        viewCellRenderer.Dispose();
                    }
                    else
                    {
                        foreach (var child in view.Subviews)
                        {
                            viewsToLookAt.Push(child);
                        }
                    }
                }
            }

            base.Dispose(disposing);
        }
Пример #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_packager == null)
                {
                    return;
                }

                Element?.ClearValue(Platform.RendererProperty);
                SetElement(null);

                _packager.Dispose();
                _packager = null;

                _tracker.NativeControlUpdated -= OnNativeControlUpdated;
                _tracker.Dispose();
                _tracker = null;

                _events.Dispose();
                _events = null;

                _insetTracker.Dispose();
                _insetTracker = null;

                ScrollAnimationEnded -= HandleScrollAnimationEnded;
                Scrolled             -= HandleScrolled;
            }

            base.Dispose(disposing);
        }