private void LoadProblem(TsumegoProblem problem) { Rectangle rect = problem.GetBoundingBoard(); BoardViewModel.BoardControlState.OriginX = rect.X; BoardViewModel.BoardControlState.OriginY = rect.Y; BoardViewModel.BoardControlState.BoardWidth = rect.Width; BoardViewModel.BoardControlState.BoardHeight = rect.Height; _currentProblem = problem; _currentProblemTree = _currentProblem.SpawnThisProblem(); CurrentProblemName = _currentProblem.Name; CurrentProblemInstructions = _currentProblemTree.Comment; CurrentNode = _currentProblemTree; _playerToMove = _currentProblem.ColorToPlay; _humansColor = _playerToMove; if (_humansColor == StoneColor.Black) { CurrentNodeStatus = Localizer.Tsumego_BlackToPlay; } else { CurrentNodeStatus = Localizer.Tsumego_WhiteToPlay; } WrongVisible = false; CorrectVisible = false; GoToPreviousProblemCommand.RaiseCanExecuteChanged(); GoToNextProblemCommand.RaiseCanExecuteChanged(); UndoOneMoveCommand.RaiseCanExecuteChanged(); RaisePropertyChanged(nameof(CurrentProblemPermanentlySolved)); }
public async void Init() { _allProblems = new List <TsumegoProblemInfo>(await _problemsLoader.GetProblemListAsync()); GoToPreviousProblemCommand.RaiseCanExecuteChanged(); GoToNextProblemCommand.RaiseCanExecuteChanged(); }