Question

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:

enter image description here

Was it helpful?

Solution

Use ViewBox for simple proportional zooming..

<ViewBox>    
    <Grid Margin="0,0,0,6" Grid.RowSpan="2">
        <!-- your stuffs -->
    </Grid>
</ViewBox>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top