-
How can the size of the main window be set when targeting the windows (10) desktop? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Thanks for the question. It would be best to ask it in the WinUI or WinAppSDK repositories. |
Beta Was this translation helpful? Give feedback.
-
Make sure you only execute this on Windows. private void ConfigureViewSize()
{
var windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(CurrentWindow);
var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle);
var appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
appWindow.Resize(new Windows.Graphics.SizeInt32 { Width = 480, Height = 800 });
} |
Beta Was this translation helpful? Give feedback.
-
Trying Uno for desktop platform. but I still get: I installed the "Windows App SDK" to get WinUI 3 |
Beta Was this translation helpful? Give feedback.
Make sure you only execute this on Windows.