In our common project, the position and size of the application's main window (WPF window) is set using the API's SetWindowPlacement method. The WINDOWPLACEMENT's showCmd has value 3. After the call, the window is actually maximized, the upper right icon shows the correct "to normal mode" image, but the Application.Current.MainWindow.WindowState is still "NORMAL". This causes a non centered modal dialog which is using WindowStartupLocation=CenterOwner. How can I fix this without additionally setting the MainWindow's WindowState to Maximized?
Asked
Active
Viewed 206 times
0
-
I cannot reproduce your issue, I'm using the same API. When do you call the `SetWindowPlacement` function? – dymanoid Feb 16 '16 at 10:45
-
The code is executed in the override of OnSourceInitialized of a subclass of Window, directly after the base call. – Michael Feb 17 '16 at 12:56
-
That is exactly how I'm doing it. What .Net Framework version do you target? – dymanoid Feb 17 '16 at 14:57