private void ball_Scored(object sender, ScoreEventArgs e) { if (e.Side == Paddle.Side.Left) { ScoreLeft += 1; } else if (e.Side == Paddle.Side.Right) { ScoreRight += 1; } OnScored(e.Side, e.Ball); DispatcherHelper.CheckBeginInvokeOnUI(() => { Balls.Remove(e.Ball); AddBall(); }); }
private void PongGame_Scored(object sender, ScoreEventArgs e) { RaisePropertyChanged("PongGame"); }
private void ball_Scored(object sender, ScoreEventArgs e) { if (e.Side == Paddle.Side.Left) { ScoreLeft += 1; } else if (e.Side == Paddle.Side.Right) { ScoreRight += 1; } OnScored(e.Side, e.Ball); DispatcherHelper.CheckBeginInvokeOnUI(() => { Balls.Remove(e.Ball); AddBall(); }); }