Home > other >  WinUI 3 How to set Minimum Size of a Window
WinUI 3 How to set Minimum Size of a Window

Time:06-26

So in UWP, we can use

ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(500, 500));

but

ApplicationView.GetForCurrentView();

returns null in WinUI 3. Is there a way to set the minimum size for a window

CodePudding user response:

You should use pinvoke take a look at here https://github.com/ghost1372/SettingsUI/blob/main/src/SettingsUI/Tools/Helpers/WindowHelper/WindowHelper.ReSizeWindow.cs

  • Related