Get Screen Resolution in Win10 UWP App

前端 未结 7 2315
刺人心
刺人心 2020-11-28 08:54

As an UWP App runs in window mode on common desktop systems the \"old\" way of getting the screen resolution won\'t work anymore.

Old Resolution with Window.C

7条回答
  •  一向
    一向 (楼主)
    2020-11-28 09:10

    Okay so the Answer from Juan Pablo Garcia Coello lead me to the Solution - Thanks for that!

    You can use

    var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
    

    but you must call it before the windows is displayed in my case right after

    Window.Current.Activate();
    

    is a good place. At this time you will get the bounds of the window on which your app will appear.

    Thanks a lot for help me solving it :)

    Regards Alex

提交回复
热议问题