示例#1
0
        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);
        }
示例#2
0
 protected virtual void OnShellSectionSet()
 {
     _appearanceTracker = _context.CreateNavBarAppearanceTracker();
     UpdateTabBarItem();
     ((IShellController)_context.Shell).AddAppearanceObserver(this, ShellSection);
     ((IShellSectionController)ShellSection).AddDisplayedPageObserver(this, OnDisplayedPageChanged);
 }
示例#3
0
        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;
        }
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                this.RemoveFromParentViewController();
                _disposed = true;
                _renderer.Dispose();
                _appearanceTracker.Dispose();
                _shellSection.PropertyChanged  -= HandlePropertyChanged;
                _context.Shell.PropertyChanged -= HandleShellPropertyChanged;

                if (_displayedPage != null)
                {
                    _displayedPage.PropertyChanged -= OnDisplayedPagePropertyChanged;
                }

                ((IShellSectionController)_shellSection).NavigationRequested -= OnNavigationRequested;
                ((IShellController)_context.Shell).RemoveAppearanceObserver(this);
                ((IShellSectionController)ShellSection).RemoveDisplayedPageObserver(this);

                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);
        }