1

this is what I tried doesn't give the right height.
What I did?

ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;

before

        var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
        var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
        var size = new Size(bounds.Width * scaleFactor, bounds.Bottom * scaleFactor);
        ScreenSize = size;

and save the screensize in a setting for that device during first run and let the app work in default window from then onwards.
This works perfectly in my laptop and my Lumia 1520 with hardware buttons.
Doesn't on Lumia 640XL with on-screen taskbar.
I need the exact resolution, Is there a way I can get that done?

Community
  • 1
  • 1
divay pandey
  • 152
  • 4
  • 8

1 Answers1

0

You can get height on phone like difference of visible top and visible bottom (if you are in portrait mode):

double visibleHeight=ApplicationView.GetForCurrentView().VisibleBounds.Bottom - ApplicationView.GetForCurrentView().VisibleBounds.Top;

and difference of visible left and right positions in landscape mode:

double visibleWidth=ApplicationView.GetForCurrentView().VisibleBounds.Right- ApplicationView.GetForCurrentView().VisibleBounds.Left;
Alexej Sommer
  • 2,677
  • 1
  • 14
  • 25