예제 #1
0
 public void LoadScene(bool overrideAddToStack)
 {
     if (overrideAddToStack)
     {
         BackStack.Push(sceneManager.data.LoadScene);
     }
     sceneManager.LoadScene(this, mode);
 }
예제 #2
0
 public void GoTo(HelpItem item)
 {
     if (CurrentItem != null)
     {
         BackStack.Push(CurrentItem);
     }
     CurrentItem = item;
     OnStackChanged();
 }
예제 #3
0
 public void GoForward()
 {
     if (CurrentItem != null)
     {
         BackStack.Push(CurrentItem);
     }
     if (ForwardStack.Count > 0)
     {
         CurrentItem = ForwardStack.Pop();
     }
     OnStackChanged();
 }
        private async void BtnForward_Click(object sender, RoutedEventArgs e)
        {
            var item = ForwardStack.Pop();

            if (ForwardStack.Count == 0)
            {
                IsbtnForwardEnabled = false;
            }
            BackStack.Push(LastSearch);
            IsbtnBackEnabled = true;
            tbID.Text        = item;
            await StartFinding();
        }
예제 #5
0
        public void LoadScene()
        {
            if (sceneManager.data.addToStack)
            {
                BackStack.Push(sceneManager.data.LoadScene);
            }

            if (loadingScreen)
            {
                sceneManager.LoadWithSceneLoader(this);
            }
            else
            {
                sceneManager.LoadScene(this, mode);
            }
        }
        public async Task ActiveStartFinding()
        {
            var id = tbID.Text;

            if (!string.IsNullOrWhiteSpace(id) && !IsRunning)
            {
                if (LastSearch != null)
                {
                    BackStack.Push(LastSearch);
                    ForwardStack.Clear();
                    IsbtnBackEnabled    = true;
                    IsbtnForwardEnabled = false;
                }
                await StartFinding();
            }
        }
        private void HandleContentNavigating(object sender, NavigatingCancelEventArgs e)
        {
            if (IsNavigating)
            {
                return;
            }
            IsNavigating = true;

            // Choose the name of the transition based on the e.ExtraData that was passed to NavigationService.Navigate().
            // If the data is a string, we'll try to find a matching transition by that name.
            if (e.ExtraData is ResolvedNavigationRequest)
            {
                var transitionName = ((ResolvedNavigationRequest)e.ExtraData).RouteValues.GetOrDefault <string>("Transition");
                CurrentTransition = transitionRegistry.Get(transitionName);
            }
            else if (e.ExtraData is string && transitionRegistry.Get(e.ExtraData.ToString()) != null)
            {
                var transitionName = e.ExtraData.ToString();
                CurrentTransition = transitionRegistry.Get(transitionName);
            }
            else
            {
                CurrentTransition = null;
            }

            // Keep a record of back/forward navigation and use this to select the reverse transitions.
            if (e.NavigationMode == NavigationMode.New)
            {
                BackStack.Push(CurrentTransition);
            }
            else if (e.NavigationMode == NavigationMode.Back)
            {
                var original = BackStack.Pop();
                ForwardStack.Push(original);
                var reverseTransition = original == null ? null : transitionRegistry.Get(original.Reverse);
                CurrentTransition = reverseTransition;
            }
            else if (e.NavigationMode == NavigationMode.Forward)
            {
                CurrentTransition = ForwardStack.Pop();
                BackStack.Push(CurrentTransition);
            }
        }