Is it possible to restrict the user from re-sizing a UWP app?

丶灬走出姿态 提交于 2019-12-23 23:07:47

问题


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.


回答1:


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.

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



来源:https://stackoverflow.com/questions/32212301/is-it-possible-to-restrict-the-user-from-re-sizing-a-uwp-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!