How to Resize Controls in silverlight

635 views Asked by At

I am working on a Silverlight application and my problem is like this: I have a StackPanel and inside the stackpanel I have a ViewBox. Inside the viewbox I am adding images and rotating them 90 and/or -90 degrees.

When rotated, my images go out of the viewbox. How can I fix this?

2

There are 2 answers

0
PhilBrown On BEST ANSWER

Use something other than StackPanel, it doesn't resize.

0
Jeff Yates On

There's a control in the Silverlight Toolkit that addresses this problem called the LayoutTransformer. It ensures that when you change the transform, the bounds of the control are within the LayoutTransformer bounds.

You can see this at work in the Silverlight Toolkit demo. Just scroll down the tree on the left to the Layout section.