Please try below code to check if it work for your project:
Step1: Add Loaded="Window_Loaded"
for the Xaml page.
Step2: Add code to it:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
double controlsize = ((SystemParameters.PrimaryScreenWidth / 12) / 3 * 2) / 5 * 0.7;
System.Windows.Application.Current.Resources.Remove("ControlFontSize");
System.Windows.Application.Current.Resources.Add("ControlFontSize", controlsize);
}
Step3 : In the Xaml page use FontSize="{DynamicResource ControlFontSize}"
for the control like:
<TextBlock Text="Button" HorizontalAlignment="Left" FontSize="{DynamicResource ControlFontSize}"
Margin="239,163,0,0" VerticalAlignment="Top" Width="75"/>
If it doesn't work for your project, please let me know.
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.