コード例 #1
0
        public async void NavigateToShellSection(ShellSection shellSection)
        {
            if (ShellSection != shellSection)
            {
                if (ShellSection != null)
                {
                    ShellSection.PropertyChanged -= ShellSectionOnPropertyChanged;
                    ShellSectionController.ItemsCollectionChanged -= ShellSectionControllerOnItemsCollectionChanged;
                    ShellSection = null;
                }

                ShellSection = shellSection;
                ShellSection.PropertyChanged += ShellSectionOnPropertyChanged;
                ShellSectionController.ItemsCollectionChanged += ShellSectionControllerOnItemsCollectionChanged;
            }

            UpdateTopTabs();

            var  content  = shellSection.CurrentItem;
            Page nextPage = (shellSection as IShellSectionController)
                            .PresentedPage ?? ((IShellContentController)content)?.GetOrCreateContent();

            SectionFrame.Navigate(new ShellPageWrapper());
            await Task.Delay(100);

            var shellSectionCurrent = Shell.CurrentItem.CurrentItem;

            NavigateToContent(new NavigationRequestedEventArgs(nextPage, true), shellSectionCurrent);
        }
コード例 #2
0
        private void OnInsertRequested(NavigationRequestedEventArgs args)
        {
            var pageIndex = ShellSection.Stack.ToList().IndexOf(args.Page);

            if (pageIndex == ((IEnumerable <object>)SectionFrame.BackStack).Count() - 1)
            {
                SectionFrame.Navigate(new ShellPageWrapper());
            }
            else
            {
                //
                //  ((IEnumerable<object>)SectionFrame.BackStack).
            }
        }
コード例 #3
0
 private async void OnPushRequested(NavigationRequestedEventArgs args)
 {
     SectionFrame.Navigate(new ShellPageWrapper());
 }