Hi Stesvis-5434,
Welcome to our Microsoft Q&A platform!
You can use DynamicResource in App.xaml instead, then you can modify the font size dynamically. Here is the documentation you can refer to: Dynamic Styles in Xamarin.Forms.
The following is a simple demo using DynamicResource.
App.xaml
<x:Double x:Key="defaultFontSize">14</x:Double>
<Style TargetType="Label">
<Setter Property="FontSize" Value="{DynamicResource defaultFontSize}" />
</Style>
<Style TargetType="Button">
<Setter Property="FontSize" Value="{DynamicResource defaultFontSize}" />
</Style>
<Style TargetType="Entry">
<Setter Property="FontSize" Value="{DynamicResource defaultFontSize}" />
</Style>
xaml.cs
protected override void OnAppearing()
{
base.OnAppearing();
App.Current.Resources["defaultFontSize"] = Preferences.Get("FontSize", 14);
}
private void ButtonSave_Clicked(object sender, EventArgs e)
{
int value = Convert.ToInt32(fontEnrty.Text);
Preferences.Set("FontSize", value);
App.Current.Resources["defaultFontSize"] = Preferences.Get("FontSize", 14);
}
Regards,
Kyle
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.