Windows Store app written using C#/VS2013.1
I have wrapped up a complex Grid/StackPanel arrangement with buttons, images, checkboxes all inside a Viewbox tag like 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 ~10% border along each edge. I've tried running this on different resolutions and devices, and everything looks perfect.
My question is, is there a downside to using Viewbox to wrap up complex/nested elements this way, versus painstakingly planning and coding width/height/font in each element so that they scale up properly to whatever resolution the app is being run on? I read some posts suggesting that Viewbox should be used only when other methods fail (or designer didn't consider scaling when XAML was first written). Is there a reason to that?