views:

367

answers:

1

hi guys:

It gets basicaly to this: I have a canvas container (x:name="Container" - to reffer later to), with some other controls(e.g. I have a Button 30x60 in size) and I want to scale the Container to fit the button, without having to resize anything. (just using scaleTransform) If I set a slider binded to the Container Scale, I can slide it to fit the button, but the value is 1.1343 and I want to be able somehow to compute this value programatically, because all the controls inside Container are of different sizes, and resizable in adition. The question is: is there a way to scale the Container so that a Control from the container is displayed on the entire Container surface? Also the position will have to be adjusted, so that the scrolling vierew of the Container should be positioned over the control, but that is done already.

Thank you in advance, Daniel

+1  A: 

Use Grid as the container. Any control placed inside of the Grid will directly fill the whole Grid, and its size (the width and height) will match the size of the Grid.

eriawan
well, seems that I explained very wrong :) i stated that the control shouldn't be changed in size, only the view should be enlarged. The value x,y for a scale transform I have to compute programatically, but I guess I found a way.thank you anywayDaniel
daniell
What was your way? Did You use a Viewbox?
Anthony
okay. what is your solution, Daniel?
eriawan