Is there any way to programmatically launch an app so that it starts in a snapped view?

心已入冬 提交于 2020-01-17 02:20:37

问题


I want to launch a URL in my JavaScript app for Windows 8 using Windows.System.Launcher.LaunchUriAsync, but I want it to start in a snapped view. Is there any way to do this?


回答1:


You can't start an app in snapped more or cause another to be started in that mode. One key thing to note is that a snapped view might not even be possible depending on the orientation or resolution of the screen. Additionally, with the philosophy of the user being in charge, it should be his/her choice to move to snapped mode.

You can programmatically move out of snapped mode (to fill mode) via TryUnsnap; however, the guidelines do state

Put the user in control. Don't programmatically unsnap your app to get the user's attention. Unsnapping should be reserved only for situations when the user tries to use a feature that is not available in the snapped state. If your app has snapped views for all pages in the app, you shouldn't need to programmatically unsnap at all.

Don't add UI controls to programmatically unsnap your app. The splitter between the apps is always present and lets the user unsnap whenever they want to.



来源:https://stackoverflow.com/questions/12737986/is-there-any-way-to-programmatically-launch-an-app-so-that-it-starts-in-a-snappe

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