For WinUI in Desktop apps:
Window
in XAML.Window
in XAML.<Window Width="1200" Height="600"
d:DesignWidth="1000" d:DesignHeight="500">
Many developers doing WinUI in Desktop will have a background in WPF and/or simply not be interested in doing a responsive design -- this is "in Desktop" after all. Without the ability to set Window size in a traditional way, I believe adoption will suffer due to too much forced change.
@JVimes, thanks for opening this request. I believe there should be APIs that allow developers to do this. The APIs should work for both, UWP and Desktop.
@marb2000 It appears not:
@JVimes, thanks for opening this request. I believe there should be APIs that allow developers to do this. The APIs should work for both, UWP and Desktop.
I'm wondering if there is any API to manage window size/position at all?
While these APIs doesn't exist in Desktop WinUI 3 apps, I published a sample to workaround it using the Win32 APIs.
Using the SetWindowPos API you can set the size and/or the position of a Window object.
Thanks for the workaround, @marb2000. The code also looks like a starting point to address the problem.