WPF/Accessibility: Setting FontSize property prevents system font scaling from working
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
**Environment:**
- .NET Core 3.1
**Problem description:**
While doing an accessibility pass for FancyZones Editor in PowerToys, we've encountered [this issue](https://github.com/microsoft/PowerToys/issues/10766). I've given a detailed explanation in [this comment](https://github.com/microsoft/PowerToys/issues/10766#issuecomment-924207415), but it boils down to the difference between `FontSize` property behavior in UWP/WPF.
**Actual behavior:**
Setting `FontSize` property in WPF prevents system-wide font scaling setting from working, no matter which [context switch overrides](https://docs.microsoft.com/en-us/dotnet/framework/whats-new/whats-new-in-accessibility#taking-advantage-of-accessibility-enhancements) are enabled.
**Expected behavior:**
Same as with UWP apps: elements' font size changes depending on the scale setting even when `FontSize` is explicitly set for them.
**Minimal repro:**
- create Blank WPF app
- go to `MainWindow.xaml` and add the following xaml inside the `Grid`:
```xaml
```
- launch the application
- Start ->"Make text size bigger" -> Change to e.g. 200%
- Observe that the text size remains the same
Now repeat the steps with a blank UWP app and observe that "Make text size bigger" option affects text size.
Contributor guide
Assessment
This issue has not been assessed yet.