Example #1
0
        private async Task SavePuzzleAsync()
        {
            IsLoading = true;
            try
            {
                puzzle.State = GameBoard.State;
                var puzzleId = await Task.Run(() => _gameRepository.SaveGame(puzzle));

                GameBoard.AcceptChanges();
                await LoadPuzzle(puzzleId);
            }
            catch (Exception ex)
            {
                GameMessage = ex.Message;
            }
            finally
            {
                IsLoading = false;
            }
        }