Reputation: 3592
I'm using ViewBox control to scale my forms in winstore application. I need stretch controls inside ViewBox but common HorizontalAlignment="Stretch" does not work
This is my code :
<Viewbox Margin="20" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Top" >
...
This is result :
ViewBox is grey rectangle, Grid is selected (blue rectangle), TextBoxes do not have set width.
Can you advise me, how to solve this? I dont want to set width explicitly.
Upvotes: 0
Views: 2189
Reputation: 19296
Try set Stretch
property to Fill
(msdn):
<Viewbox Margin="20" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch"
Stretch="Fill">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
Upvotes: 1