public override void ViewDidDisappear(bool animated) { base.ViewDidDisappear(animated); if (!_appeared || _disposed) { return; } _appeared = false; Carousel.SendDisappearing(); }
protected override void Dispose(bool disposing) { if (disposing && !_disposed) { if (_scrollView != null) { _scrollView.DecelerationEnded -= OnDecelerationEnded; } if (Carousel != null) { Carousel.PropertyChanged -= OnPropertyChanged; Carousel.PagesChanged -= OnPagesChanged; } Platform.SetRenderer(Element, null); Clear(); if (_scrollView != null) { _scrollView.DecelerationEnded -= OnDecelerationEnded; _scrollView.RemoveFromSuperview(); _scrollView = null; } if (_appeared) { _appeared = false; Carousel.SendDisappearing(); } if (_events != null) { _events.Dispose(); _events = null; } if (_tracker != null) { _tracker.Dispose(); _tracker = null; } Element = null; _disposed = true; } base.Dispose(disposing); }