示例#1
0
        public async void NavView_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
        {
            if ((SettingControl?.IsOpened).GetValueOrDefault())
            {
                if (Nav.CurrentSourcePageType == typeof(TabViewContainer))
                {
                    NavView.IsBackEnabled = (TabViewContainer.CurrentTabNavigation?.CanGoBack).GetValueOrDefault();
                }
                else
                {
                    NavView.IsBackEnabled = false;
                }

                if (NavView.MenuItems.Select((Item) => Item as NavigationViewItem).FirstOrDefault((Item) => Item.Content.ToString() == PageDictionary[Nav.CurrentSourcePageType]) is NavigationViewItem Item)
                {
                    Item.IsSelected = true;
                }

                await SettingControl.Hide().ConfigureAwait(false);
            }
            else
            {
                TabViewContainer.GoBack();
            }
        }
示例#2
0
 private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
 {
     TabViewContainer.GoBack();
     e.Handled = true;
 }