Ejemplo n.º 1
0
        /// <summary>
        ///     Save state before navigating
        /// </summary>
        /// <param name="suspensionState"></param>
        /// <param name="suspending"></param>
        /// <returns></returns>
        public override async Task OnNavigatedFromAsync(IDictionary <string, object> suspensionState, bool suspending)
        {
            if (suspending)
            {
                suspensionState[nameof(CurrentMessage)] = JsonConvert.SerializeObject(CurrentMessage);
                suspensionState[nameof(Messages)]       = JsonConvert.SerializeObject(Messages);
            }

            HideAllScreens?.Invoke(this, null);

            await Task.CompletedTask;
        }
Ejemplo n.º 2
0
        private void SelectTutorialScreen(RepeatedField <TutorialState> tutorialState)
        {
            HideAllScreens?.Invoke(this, null);

            if (!tutorialState.Contains(TutorialState.LegalScreen))
            {
                currentState    = TutorialState.LegalScreen;
                LegalCommsCheck = true;
                RaisePropertyChanged(nameof(LegalCommsCheck));
                ShowLegalScreen?.Invoke(this, null);
                return;
            }
            if (!tutorialState.Contains(TutorialState.AvatarSelection))
            {
                currentState = TutorialState.AvatarSelection;
                ShowSelectAvatarScreen?.Invoke(this, null);
                return;
            }
            if (!tutorialState.Contains(TutorialState.PokemonCapture))
            {
                currentState = TutorialState.PokemonCapture;
                ShowPokemonCaptureScreen?.Invoke(this, null);
                return;
            }
            if (!tutorialState.Contains(TutorialState.NameSelection))
            {
                currentState = TutorialState.NameSelection;
                ShowNameSelectionScreen?.Invoke(this, null);
                return;
            }
            if (!tutorialState.Contains(TutorialState.FirstTimeExperienceComplete))
            {
                currentState = TutorialState.FirstTimeExperienceComplete;
                ShowItsTimeToWalkScreen?.Invoke(this, null);
                return;
            }
            currentState = TutorialState.PokestopTutorial;
        }