Reputation: 43
I have WPF application work with 1024x768
screen resolution, now I want to run this application on Microsoft Surface with wide resolution, I had make new windows with resolution 1366x768
, but unfortunately I can't make it work fine on Surface, I tested it on my laptop, it's work 100%, but I don't understand why it would't work in the same way on Surface.
If there is anyone that has experience with Surface can you please help?
When I run the WPF windows with resolution 1920x1080
work full screen on my laptop, but the problem is when run application on Surface with the same resolution don't fit the full screen, see this screenshot to more clarity:
Upvotes: 1
Views: 1696
Reputation: 18118
In WPF you should not be setting a constant window size, instead you should:
Make the window's content react to the window size by using auto sizes and grids instead of constant sizes and panels
You can use WindowState="Maximized"
to make the window full screen
You can prevent your window from being reduced too much with minwidth and minheight.
Upvotes: 0
Reputation: 1637
Maybe your surface and laptop have different DPI settings. See here how to handle that problem.
Upvotes: 4
Reputation: 862
From the information provided it may be that your WPF window layout doesn't sufficiently take into account differences in Display text and item sizing on different devices.
On both your Surface Pro and your laptop:
By default the Surface Pro is set to Larger. A new Windows 8 install will be set to Smaller.
Upvotes: 1