protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { (Shell.Current as IShellController).RemoveAppearanceObserver(this); (Shell.Current as IShellController).RemoveFlyoutBehaviorObserver(_navBar); if (ShellSection != null) { IShellSectionController controller = ShellSection; controller.NavigationRequested -= OnNavigationRequested; controller.RemoveDisplayedPageObserver(this); } if (_currentPage != null) { _currentPage.PropertyChanged -= OnPagePropertyChanged; } if (_navBar != null) { _navBar.Dispose(); _navBar = null; } Unrealize(); } _disposed = true; }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_section != null) { IShellSectionController controller = _section as IShellSectionController; controller.NavigationRequested -= OnNavigationRequested; controller.RemoveDisplayedPageObserver(this); _section.PropertyChanged -= OnSectionPropertyChanged; _section = null; } if (_currentPage != null) { _currentPage.PropertyChanged -= OnPagePropertyChanged; } Unrealize(); } _disposed = true; }