Пример #1
0
        void UpdateIsPresented()
        {
            // To update TabIndex order
            CustomFocusManager.StartReorderTabIndex();

            _mdpage.IsPresented = Element.IsPresented;
        }
Пример #2
0
        /// <summary>
        /// Handles the process of switching between the displayed pages.
        /// </summary>
        /// <param name="sender">An object originating the request</param>
        /// <param name="ea">Additional arguments to the event handler</param>
        void OnCurrentPageChanged(object sender, EventArgs ea)
        {
            // To update TabIndex order
            CustomFocusManager.StartReorderTabIndex();

            Element.UpdateFocusTreePolicy();

            if (IsChangedByScroll())
            {
                return;
            }

            if (Element.CurrentPage != Element.Children[_pageIndex])
            {
                var previousPageIndex = _pageIndex;
                _pageIndex = Element.Children.IndexOf(Element.CurrentPage);
                if (previousPageIndex != _pageIndex)
                {
                    // notify disappearing/appearing pages and scroll to the requested page
                    (Element.Children[previousPageIndex] as IPageController)?.SendDisappearing();
                    _scroller.ScrollTo(_pageIndex, 0, false);
                    (Element.CurrentPage as IPageController)?.SendAppearing();
                }
            }
        }
Пример #3
0
        void OnCurrentPageChanged()
        {
            // To update TabIndex order
            CustomFocusManager.StartReorderTabIndex();

            if (_isUpdateByScroller || _isUpdateByToolbar || !_isInitialized)
            {
                return;
            }

            _isUpdateByCurrentPage = true;
            Page oldPage = null;

            if (_toolbar.SelectedItem != null && _itemToItemPage.ContainsKey(_toolbar.SelectedItem))
            {
                oldPage = _itemToItemPage[_toolbar.SelectedItem];
            }

            oldPage?.SendDisappearing();
            Element.CurrentPage?.SendAppearing();

            int index = MultiPage <Page> .GetIndex(Element.CurrentPage);

            _toolbarItemList[index].IsSelected = true;
            _scroller.ScrollTo(index, 0, true);

            Element.UpdateFocusTreePolicy();
            _isUpdateByCurrentPage = false;
        }