Hi all:
I have an app with 3 labels across the top to display app information, and I put them in ViewBoxes to try to deal with scaling on machines with different resolutions. It seems to work, but the text in the labels shows as 3 different font sizes, which looks sloppy. Can anyone recommend how I can deal with this? The XAML is pasted below.
Thanks for any and all help.
John.
<Style x:Key="HeaderLabelStyle" TargetType="TextBlock" BasedOn="{StaticResource HeaderTextStyle}">
<Setter Property="Foreground" Value="DarkOrchid"/>
<Setter Property="FontSize" Value="46"/>
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
<Setter Property="TextTrimming" Value="WordEllipsis"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Typography.StylisticSet20" Value="True"/>
<Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
<Setter Property="Typography.CaseSensitiveForms" Value="True"/>
</Style>
<!-- Header -->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Viewbox Grid.Column="0" Grid.Row="0" >
<Button x:Name="cmdNo" Height="100" Width="100" Click="cmdNo_Click" BorderThickness="0">
<StackPanel>
<Image Source="Assets/pic.jpg"/>
</StackPanel>
</Button>
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="0" >
<Button x:Name="cmdHint" Height="100" Width="100" BorderThickness="0">
<StackPanel>
<Image Source="Assets/hint.jpg"/>
</StackPanel>
</Button>
</Viewbox>
<Viewbox Grid.Row="0" Grid.Column="2" >
<TextBlock x:Name="B1" Text="Text" Visibility="Visible" Style="{StaticResource HeaderLabelStyle}" Margin="10,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Viewbox>
<Viewbox Grid.Row="0" Grid.Column="3" >
<TextBlock x:Name="B2" Text="Text" Visibility="Visible" Style="{StaticResource HeaderLabelStyle}" Margin="10,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Viewbox>
<Viewbox Grid.Row="0" Grid.Column="4" >
<TextBlock x:Name="B3" Text="Text" Visibility="Visible" Style="{StaticResource HeaderLabelStyle}" Margin="10,10,10,10" HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Viewbox>
<Viewbox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="-10,0,10,0">
<TextBlock x:Name="B4" Text="Text" Visibility="Visible" Style="{StaticResource NoStyle}" Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center"
FontWeight="Bold" FontSize="36"/>
</Viewbox>
</Grid>