是否可以限制用户重新调整 UWP 应用的大小? [英] Is it possible to restrict the user from re-sizing a UWP app?

查看:23
本文介绍了是否可以限制用户重新调整 UWP 应用的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我现有的 WP8 应用程序移植到 Windows-10.计划以 WP10 作为第一阶段的主要目标分阶段发布它.但是,我希望能够在第 1 阶段将相同/稍微放大的 UI 发布到桌面.我一直在玩一个示例应用程序,试图通过处理 CoreWindow 的 SizeChanged 事件并阻止它传播来限制窗口大小调整.然而,这似乎对我不起作用.我现在想知道是否有可能完全限制用户重新调整 UWP 应用程序的大小?任何帮助/指针将不胜感激.

I am trying to port my existing WP8 app to Windows-10. Planning to release it in phases with just WP10 as primary target for phase-1. However I want to be able to release the same/slightly-scaled-up UI to desktop as well in phase-1. I have been playing around with a sample app trying to restrict window resizing by handling CoreWindow's SizeChanged event and preventing it from propagating. However this doesn't seem to do it for me. I am now wondering is it possible to restrict the user from re-sizing a UWP app at all? Any help/pointers would be much appreciated.

推荐答案

PreferredLaunchViewSizePreferredLaunchWindowingMode 应该有助于预先设置屏幕尺寸.使用 SetPreferredMinSize设置应用程序窗口的最小尺寸.

PreferredLaunchViewSize and PreferredLaunchWindowingMode should helps to pre set the screen size. SetPreferredMinSize is used to set the minimum size of the app window.

我个人认为限制应用程序的窗口大小不是一个好习惯,因为一切都应该在用户的控制之下.

Personally I don't think its a good practice to restrict the window size of the app since everything should under user's control.

无论如何TryResizeView |tryResizeView 方法应该有助于调整应用大小.

Anyway TryResizeView | tryResizeView method should help to resize the app size.

这篇关于是否可以限制用户重新调整 UWP 应用的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆