private void GameArea_SizeChanged(object sender, SizeChangedEventArgs e) { GamePaddle = Paddle.getInstance(GameArea); double paddleX = (GameArea.ActualWidth / 2) - (GamePaddle.Width / 2); double paddleY = GameArea.ActualHeight - 10 - GamePaddle.Height; GamePaddle.Position = new Point(paddleX, paddleY); GamePaddle.Draw(GameArea); }
private void Playground_ContentRendered(object sender, EventArgs e) { Background = new ImageBrush { ImageSource = new BitmapImage(new Uri(System.IO.Path.GetFullPath("Assets/Images/earthBackgr.jpg"), UriKind.Absolute)) }; GamePaddle = Paddle.getInstance(GameArea); GamePaddle.Draw(GameArea); PingPongBall.Draw(GameArea); bdrWelcomePanel.Visibility = Visibility.Visible; }