I have a mouse up event that draws an ellipse. When the window is resized I want the balls to move and scale with the canvas - so if the ball is 10% from the top and 10% from the left, I want it to be in the same relative spot whether the canvas is 1000px wide or 50px wide. Ideas?
Ellipse ball = new Ellipse(); ball.Width = 30; ball.Height = 30; ball.Fill = new SolidColorBrush(Colors.OrangeRed); Point p = Mouse.GetPosition(court); court.Children.Add(ball); Canvas.SetLeft(ball, p.X - (ball.Width/2.0)); Canvas.SetTop(ball, p.Y - (ball.Height/2.0));