Get Screen Resolution in Win10 UWP App

前端 未结 7 2313
刺人心
刺人心 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:32

    The only way I found is inside the constructor of a Page:

     public MainPage()
        {
            this.InitializeComponent();
    
            var test = ApplicationView.GetForCurrentView().VisibleBounds;
        }
    

    I have not tested in Windows 10 Mobile, when the new release appears I will test that.

提交回复
热议问题