コード例 #1
0
ファイル: MainViewModel.cs プロジェクト: willvin313/Chessman
        public void OnNavigatingFrom()
        {
            if (AnalysisViewModel.IsEngineOn)
            {
                boardService.Stop();
            }

            AnalysisViewModel.UnsubscribeToAnalysis();
        }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: willvin313/Chessman
        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;
        }
コード例 #3
0
ファイル: MainViewModel.cs プロジェクト: willvin313/Chessman
        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();
            }
        }