示例#1
0
        public void SetElement(VisualElement element)
        {
            var oldElement = Element;

            Element = element;

            FinishedCustomizingViewControllers += HandleFinishedCustomizingViewControllers;
            Tabbed.PropertyChanged             += OnPropertyChanged;
            Tabbed.PagesChanged += OnPagesChanged;

            OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));

            _pageLifecycleManager = new PageLifecycleManager(Element as IPageController);

            OnPagesChanged(null, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));

            if (element != null)
            {
                element.SendViewInitialized(NativeView);
            }

            //disable edit/reorder of tabs
            CustomizableViewControllers = null;

            UpdateBarBackgroundColor();
            UpdateBarBackground();
            UpdateBarTextColor();
            UpdateSelectedTabColors();
            UpdateBarTranslucent();

            EffectUtilities.RegisterEffectControlProvider(this, oldElement, element);
        }
示例#2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                (this as IDisconnectable).Disconnect();

                _pageLifecycleManager?.Dispose();
                _events?.Dispose();
                _packager?.Dispose();
                _tracker?.Dispose();
                _events               = null;
                _packager             = null;
                _tracker              = null;
                _pageLifecycleManager = null;

                Element = null;
                Container?.Dispose();
                _pageContainer = null;
            }

            _disposed = true;

            base.Dispose(disposing);
        }
示例#3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _pageLifecycleManager?.Dispose();
                _pageLifecycleManager               = null;
                Tabbed.PropertyChanged             -= OnPropertyChanged;
                Tabbed.PagesChanged                -= OnPagesChanged;
                FinishedCustomizingViewControllers -= HandleFinishedCustomizingViewControllers;
            }

            base.Dispose(disposing);
        }
示例#4
0
        public void SetElement(VisualElement element)
        {
            VisualElement oldElement = Element;

            Element = element;
            UpdateTitle();

            OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));

            _pageLifecycleManager = new PageLifecycleManager(Element as IPageController);

            if (element != null)
            {
                if (!string.IsNullOrEmpty(element.AutomationId))
                {
                    SetAutomationId(element.AutomationId);
                }

                element.SendViewInitialized(NativeView);

                var parent = Element.Parent;

                while (!Application.IsApplicationOrNull(parent))
                {
                    if (parent is ShellContent)
                    {
                        _isInItems = true;
                    }

                    if (parent is ShellSection shellSection)
                    {
                        _shellSection = shellSection;
                        ((IShellSectionController)_shellSection).AddContentInsetObserver(this);

                        break;
                    }

                    parent = parent.Parent;
                }
            }

            EffectUtilities.RegisterEffectControlProvider(this, oldElement, element);
        }