Reputation: 373
In my application I have a a datagrid and some buttons. The datagrid is inside of a scrollbar , but it is how I want. I can not manage to zoom the buttons. When I make the window smaller, I would like the buttons to auto resize too. In order to do that , I put the buttons on a grid panel and I wrote this:
<Grid Margin="0,0,0,6" Grid.RowSpan="2">
<Grid.LayoutTransform>
<ScaleTransform x:Name="ApplicationScaleTransform"
CenterX="0"
CenterY="0"
ScaleX="1.0"
ScaleY="1.0" />
</Grid.LayoutTransform>
But there is no effect. How could I do this? Scaling the entire window , made my datagrid also to be zoomed , and I don't want to.
A picture to see how it looks now:
Upvotes: 2
Views: 375
Reputation: 2665
Use ViewBox
for simple proportional zooming..
<ViewBox>
<Grid Margin="0,0,0,6" Grid.RowSpan="2">
<!-- your stuffs -->
</Grid>
</ViewBox>
Upvotes: 1