public async void Handle(guessResponseEvent message) { guessFeedbackBox.Visibility = Visibility.Visible; if (!message._isGoodGuess) { Storyboard sb = MarginGrid.FindResource("shakeAnimation") as Storyboard; sb.Begin(); } else { sendMessage.IsEnabled = false; sendGuess.IsEnabled = false; } await Task.Delay(1000); guessFeedbackBox.Visibility = Visibility.Hidden; }
public void Handle(guessResponseEvent message) { if (message._isGoodGuess) { guessFeedBackText = "Good Guess !"; guessFeedBackSource = "/Resources/good guess.png"; } else { if (this.guessesLeft.isVisible) { this.guessesLeft.guess--; } this.NotifyOfPropertyChange(() => this.GuessesLeft); guessFeedBackText = "Bad Guess !"; guessFeedBackSource = "/Resources/bad guess.png"; } }