Resizing an element

Apr 14, 2011 at 8:41 AM


Firstly ... Wow ... this is great! I was able to create screen full of rectangles that obey the laws of physics within about 10 minutes, all with no code-behind. Genius.

I searched the forum, and found a few similar questions, but couldn't quite get my head around the answers!

I have created a number of rectangles in XAML (I am not a Blend user, so have done this in the XML), and they all behave as they should. However, I would like to make these rectangles expand and contract. I understand that changing the size on the Rectangle element itself does not update the representation of this object that the underlying physics engine uses. In other words, if I make the rectangle wider, it behaves as if it were the original size.

So, my question is, when I re-size a Rectangle, how do I update its underlying model?

I understand how to get the underlying representation of the element via the controller as follows:


However I am not sure what to do next!

Many Thanks, Colin E.