private void GameStart()
        {
            Deck = new PlayingCardDeck();

            Deck.Shuffle();

            PlayersHandTotal = 0;
            PlayersHand.Clear();

            DealersHandTotal = 0;
            DealersHand.Clear();

            ButtonsEnabled = true;

            PlayerScoreText = "Players score: " + PlayerGameScore.ToString();
            DealerScoreText = "Dealers score: " + DealerGameScore.ToString();

            PlayersHand.Add(Deck.RemoveTopCard());
            DealersHand.Add(Deck.RemoveTopCard());
            PlayersHand.Add(Deck.RemoveTopCard());
            DealersHand.Add(Deck.RemoveTopCard());

            DealersHandTotalText = "Dealers hand total: " + DealersHandTotal;

            OnPropertyChanged(nameof(PlayersHand));

            PlayersHandTotal     = UpdateScore(PlayersHand);
            PlayersHandTotalText = "Players hand total: " + PlayersHandTotal.ToString();

            ConvoText = "Players turn";
        }
        private async Task UpdateGameScore(CancellationToken ct)
        {
            try
            {
                if (!ct.IsCancellationRequested)
                {
                    if (PlayersHandTotal > DealersHandTotal)
                    {
                        PlayerGameScore++;
                        PlayerScoreText = "Players score: " + PlayerGameScore.ToString();
                        ConvoText       = "Players hand wins.";
                    }
                    else if (PlayersHandTotal < DealersHandTotal)
                    {
                        DealerGameScore++;
                        DealerScoreText = "Dealers score: " + DealerGameScore.ToString();
                        ConvoText       = "Dealers hand wins.";
                    }
                    else if (PlayersHandTotal == DealersHandTotal)
                    {
                        DealerGameScore++;
                        ConvoText = "Draw, points go to dealer.";
                    }

                    await Task.Delay(2000, ct);
                    await CheckIfGameContinues(ct);
                }
            }
            catch (OperationCanceledException)
            {
            }
        }
 public void ResetGame()
 {
     DealersHandTotalText = string.Empty;
     PlayersHandTotalText = string.Empty;
     ConvoText            = string.Empty;
     DealerGameScore      = 0;
     PlayerGameScore      = 0;
     DealerScoreText      = "Dealers score: " + DealerGameScore.ToString();
     PlayerScoreText      = "Players score: " + PlayerGameScore.ToString();
 }