I need to change the default font size of the app, how can I do that?
I am open to different options:
- Ideally, if possible, set a different font size to 12, and have FontSize="Small", FontSize="Large" etc. automatically scale based on my new Default size (probably just a big hope).
- Set font sizes in App.xaml and then use them as
- I want to set a different size for Phone and Tablet
This is what I tried, but it doesn't work
App.xaml:
<OnIdiom x:Key="defaultFontSize" x:TypeArguments="x:Int32">
<OnIdiom.Phone>12</OnIdiom.Phone>
<OnIdiom.Tablet>14</OnIdiom.Tablet>
</OnIdiom>
<Style TargetType="Label">
<Setter Property="FontSize" Value="{StaticResource defaultFontSize}"></Setter>
</Style>
Main.xaml:
<Label Text="Testing the font size"></Label>
but my text "Testing the font size" just looks the same (i also tried increasing the size to 30 to make sure).
If I do this instead, it throws an exception:
<Label Text="Testing the font size" FontSize="{StaticResource defaultFontSize}"></Label>
Is it possible to achieve what I am trying to do? Thanks