Advantages / Disadvantages of Using Viewbox to Scale C # XAML

Windows Store app written using C # / VS2013.1

I completed the complex Grid / StackPanel layout with buttons, images, checkboxes inside the Viewbox tag, as shown below:

<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="8*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="8*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Viewbox Grid.Row="1" Grid.Column="1" Stretch="Uniform">
          <Grid>
          ... (lots of nested elements)
          </Grid>
        </Viewbox>
</Grid>

The goal is to dynamically scale the page, leaving a border of ~ 10% along each edge. I tried to run this on different resolutions and devices, and everything looks perfect.

, Viewbox / , // , , ? , Viewbox , ( XAML). ?

+4
1

" " , Viewbox , Grid 80%, , , .

, " " (.. ..), . , , , , - .

+3

Source: https://habr.com/ru/post/1531250/


All Articles