You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having problem setting WPF window based desktop .NET 8 application to work as DpiAware and preventing automatic scaling of a window.
System default automatic scaling schema…
When user changes Windows 10 display setting scale, WPF-Window is being scaled accordingly.
Also, when window is dragged to another display, that has different scale, window is being scaled.
I want to prevent these automatic scaling because I’m using my own scaling schema.
Before .NET 8, when application was using WPF 4.8, following two items together were preventing such automatic behavior:
So, RuntimeHostConfigurationOption has done the job!
Now, if I run my WPF Application at my development Laptop which has full HD screen (1920 x 1080) run successfully and if I change the screen scaling from 125% to other option like 100%, 175% etc then my application UI is not scale according to Windows OS scaling and that the thing I want.
But if I run my application at full HD and suddenly change the Laptop screen resolution to 1366 x 768 or any other lower resolution while running the app, my WPF App UI perfectly scale and fit according to it, but if I close the application and start again at that lower resolution then it's not working somehow the Per Monitor DPI Awareness not trigger in.
The main problem is if I start my application on another display or another computer the DPI Awareness not working though I already declared it as Per Monitor DPI in the App.Manifest but it's not working. The RuntimeHostConfigurationOption code successfully prevent the scaling but the DPI Awareness is not working.
Original Comments
Nicole Hu [MSFT] on 9/18/2024, 11:15 AM:
We have converted this feedback item to a problem. This change was done to better reflect the feedback’s nature. It will allow other developers to easily find it and engage on it.
Feedback Bot on 9/18/2024, 00:39 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered:
This issue has been moved from a ticket on Developer Community.
Hi,
I am having problem setting WPF window based desktop .NET 8 application to work as DpiAware and preventing automatic scaling of a window.
System default automatic scaling schema…
When user changes Windows 10 display setting scale, WPF-Window is being scaled accordingly.
Also, when window is dragged to another display, that has different scale, window is being scaled.
I want to prevent these automatic scaling because I’m using my own scaling schema.
Before .NET 8, when application was using WPF 4.8, following two items together were preventing such automatic behavior:
A) @ app.manifest
...
...
B) @ app.config
Now, @ .NET 8,, that is not working anymore!
Though I found some solution that app.config file is not NET 8 compatible.
So, AppContextSwitchOverrides … Switches like…
Switch.System.Windows.DoNotScaleForDpiChanges
are transferred from
“appname”.config => “appname”.runtimeconfig.json
In order to control these switches … I had to put new item group into *.csproj
So, RuntimeHostConfigurationOption has done the job!
Now, if I run my WPF Application at my development Laptop which has full HD screen (1920 x 1080) run successfully and if I change the screen scaling from 125% to other option like 100%, 175% etc then my application UI is not scale according to Windows OS scaling and that the thing I want.
But if I run my application at full HD and suddenly change the Laptop screen resolution to 1366 x 768 or any other lower resolution while running the app, my WPF App UI perfectly scale and fit according to it, but if I close the application and start again at that lower resolution then it's not working somehow the Per Monitor DPI Awareness not trigger in.
The main problem is if I start my application on another display or another computer the DPI Awareness not working though I already declared it as Per Monitor DPI in the App.Manifest but it's not working. The
RuntimeHostConfigurationOption
code successfully prevent the scaling but the DPI Awareness is not working.Original Comments
Nicole Hu [MSFT] on 9/18/2024, 11:15 AM:
We have converted this feedback item to a problem. This change was done to better reflect the feedback’s nature. It will allow other developers to easily find it and engage on it.
Feedback Bot on 9/18/2024, 00:39 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: