protected override void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { this.RemoveFromParentViewController(); _disposed = true; _renderer.Dispose(); _appearanceTracker.Dispose(); (this as IDisconnectable).Disconnect(); foreach (var tracker in ShellSection.Stack) { if (tracker == null) { continue; } DisposePage(tracker, true); } } _disposed = true; _displayedPage = null; _shellSection = null; _appearanceTracker = null; _renderer = null; _context = null; base.Dispose(disposing); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing && !_disposed) { _disposed = true; _renderer.Dispose(); _appearanceTracker.Dispose(); _shellSection.PropertyChanged -= HandlePropertyChanged; if (_displayedPage != null) { _displayedPage.PropertyChanged -= OnDisplayedPagePropertyChanged; } ((IShellSectionController)_shellSection).NavigationRequested -= OnNavigationRequested; ((IShellController)_context.Shell).RemoveAppearanceObserver(this); ((IShellSectionController)ShellSection).RemoveDisplayedPageObserver(this); } _displayedPage = null; _shellSection = null; _appearanceTracker = null; _renderer = null; }