Exemple #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                Element.PropertyChanged -= OnElementPropertyChanged;
                Platform.SetRenderer(Element, null);
                if (_appeared)
                {
                    Page.SendDisappearing();
                }

                _appeared = false;

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

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

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

                Element   = null;
                _disposed = true;
            }

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                if (Carousel != null)
                {
                    Carousel.PropertyChanged -= OnElementPropertyChanged;
                    Carousel.PagesChanged    -= OnPagesChanged;
                }

                Platform.SetRenderer(Element, null);

                if (_appeared)
                {
                    _appeared = false;
                    Page?.SendDisappearing();
                }

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

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

                Element   = null;
                _disposed = true;
            }

            base.Dispose(disposing);
        }