1

Is there a workaround to the imposed limitation by Microsoft in order to set a Minimum Size of an UWP Application larger than 500x500? Without the limitation I would simply do:

ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(800, 600));

There was a similar question and a proposed workaround, but as stated in the comments, it provokes flickering, as it simply resizes the Window back, but does not disallow making it smaller in the first place.

drilow
  • 412
  • 2
  • 10

1 Answers1

0

I'm afraid this is the current state of things. I suggest this should be reported to the WinUI GitHub repository, as it might be something to be discussed for future versions of WinUI/UWP API.

I suppose the reasoning is that specifying minimum size higher than these bounds would limit the users with smaller screen size from using the application. Because screen size is not a requirement which can be enforced, it is preferred that applications are functional at different sizes.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
  • I am aware that there is no standard way of doing this, but is there a possible hack? Maybe custom classes or similar? My application is company-internal, so I know where it will be used, and it makes no sense to design for smaller displays. At the same time, it looks buggy if the application can be resized to a non-functional size. – drilow Jan 09 '20 at 15:31
  • Still from the standpoint of functionality, it is better to ensure all sizes are supported. The easiest thing you can do is to put all content of your app into a scrollviewer, which will have your desired minimum size, so if someone resizes the window to be smaller, the scrollbars will appear. This is far from ideal, but it works. Alternatively, you could build the application using WPF and use the UWP APIs and UI (with XAML Islands). – Martin Zikmund Jan 09 '20 at 15:37
  • Just saying from my personal experience, requirements change :-D . We have once developed an internal application which was supposed to run on exactly one kind of Android tablets, but after a year it was decided that support for phone devices should be added, and doing so after the application is finalized is a daunting thing... – Martin Zikmund Jan 09 '20 at 15:39
  • Thank you for your tips, I will definitely take it into account. However, that is addressing the premise of the question rather than the question itself ;) – drilow Jan 09 '20 at 15:41
  • I know :-D . In any case, I don't think there is a solution other than the workaround you linked in your question. – Martin Zikmund Jan 09 '20 at 15:44