public void OnNavigatingFrom() { if (AnalysisViewModel.IsEngineOn) { boardService.Stop(); } AnalysisViewModel.UnsubscribeToAnalysis(); }
private void InitSettings() { BoardViewModel.ShowSuggestedMoveArrow = (bool)appSettings.Values[AppPersistenceManager.ShowBestMoveArrowKey]; BoardViewModel.ShowLegalMoves = (bool)appSettings.Values[AppPersistenceManager.ShowLegalMovesKey]; BoardViewModel.PlaySounds = (bool)appSettings.Values[AppPersistenceManager.EnableMoveSoundsKey]; AnalysisViewModel.SetAnalysisLines((int)appSettings.Values[AppPersistenceManager.MultipleLinesKey]); bool useFigurineNotation = (int)appSettings.Values[AppPersistenceManager.NotationTypeKey] == (int)NotationType.Figurines; AnalysisViewModel.UseFigurineNotation = useFigurineNotation; NotationViewModel.UseFigurineNotation = useFigurineNotation; }
public override void OnNavigatedTo(object parameter) { InitSettings(); AnalysisViewModel.SubscribeToAnalysis(); if (!firstNavigatedToOcurred && parameter == null) { parameter = AppPersistenceManager.GetSavedPosition(appSettings, AppPersistenceManager.SavedAnalysisPositionPgnKey); } base.OnNavigatedTo(parameter); if (AnalysisViewModel.IsEngineOn) { boardService.Start(); } }