WPF application launches as much as possible, but the screen resolution does not match the display

I have a WPF application and I define the window in XAML as the maximum, and 1080x1920 (vertical format 1080p):

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"           
    x:Class="PLBCarousel.MainWindow"
    x:Name="Window"
    Width="1080" Height="1920" WindowStartupLocation="CenterScreen" WindowState="Maximized" KeyDown="Window_KeyDown">

When I launch the application on the 1080w x 1920h display, when the taskbar is hidden, it starts as much as possible, but all the elements are offset, and the view window provides the following values:

    System.Windows.SystemParameters.PrimaryScreenHeight 1536.0  double
    System.Windows.SystemParameters.PrimaryScreenWidth  864.0   double

This application displayed correctly on the same display in the past, but the screen was used as an additional display, not the primary one.

Any ideas why this is happening? I think the above two values ​​should be allowed before 1920 and 1080 respectively.

+3
source share
1 answer

, DPI . Win 7 : Win 7 DPI change.

, .

+1

All Articles