示例#1
0
        public async void LoadSelectedGame(GameListElement selectedItem)
        {
            if (SelectionMode == 1)
            {
                SelectionMode = 0;
                if (IsGameStarted)
                {
                    return;
                }

                try
                {
                    IsGameStarted = true;
                    await UserModel.GetSelectedGameData(selectedItem.IdGame);

                    GameField = new GameField(Game, GameStateInfo, Navigation);
                    await Navigation.PushAsync(GameField);
                }
                catch (Exception)
                {
                    await App.Current.MainPage.DisplayAlert("Error", "The game was cancelled", "OK");

                    SelectionMode = 1;
                }
                finally
                {
                    IsGameStarted = false;
                    UpdateGameList();
                }
            }
        }
示例#2
0
        public async void LoadSelectedGame(GameListElement selectedItem)
        {
            if (SelectionMode == 1)
            {
                SelectionMode = 0;
                await GameHistoryModel.GetSelectedGameData(selectedItem.IdGame);

                GameField = new Views.GameField(Game, GameStateInfo, Navigation);
                await Navigation.PushAsync(GameField);

                GameHistoryModel.IsGameStarted = false;
                UpdateGameList();
            }
        }