Resize WPF application to different screen resolutions.

I built a wpf application for a screen resolution of 1920*1080 ...
however the user will sometimes use a resolution 3810*2160.
How to i make my application so it keeps its aspect ratio in a way that if in a screen resolution of 1920*1080  occupies 80% of screen then in a screen resolution of 3840*2160 it also occupies 80% of screen.
I will be looking into font sizes and all that stuff too... but at least for now I need that the grids, windows and controls all resize accordingly.

Juan GiraldoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Your can try to use system parameters to get  screen resolution:
<Window x:Class="YourApplication.MainWindow"
//------your other code--------
   Height="{Binding SystemParameters.PrimaryScreenHeight}" 
    Width="{Binding SystemParameters.PrimaryScreenWidth}">

Open in new window

Generally WPF containers are designed to do just that.  Grids / stackpanels etc should all flow as the screen increases.
Did you use a Canvas as the base control?

And specify what you mean in terms of the scaling.  If this happens to be a graphic-centric app, then the easiest way would be to apply a scaletransform (render) to the root panel based on the screen dimensions.
But that would increase everything (including font sizes).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.