强制WinRT应用程序捕捉视图

编程入门 行业动态 更新时间:2024-10-18 22:33:41
本文介绍了强制WinRT应用程序捕捉视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

对于我的一个应用程序,我想在点击一个按钮后将其发送到快照视图.据我所知,没有可用的公共API将正在运行的应用程序发送到快照视图.有没有人找到解决方法来做到这一点?

For one of my apps I'd like to send the app to snapped view after tapping a button. As far as I know there's no public API available to send a running application to snapped view. Did anyone find a workaround to do this?

应该可以,因为您可以在Windows 8本身中完成操作,并捕捉其中一个正在运行的应用程序.

Somehow it should be possible since you're able to do it in Windows 8 itself, and snap one of the running apps.

更新:能够触发Win +.也许可以达到相同的效果,但是 SendKeys WinRT中也不提供API.

Update: Being able to trigger a Win+. might do the same trick, but the SendKeys API isn't available in WinRT either.

推荐答案

Windows 10具有 ApplicationView.TryResizeView 方法

Windows 10 has a ApplicationView.TryResizeView method

所以...总结一下有趣的WinRT旅程:

So... to summarize the interesting WinRT journey:

具有锁定"模式,只有一个用户可以启动.开发人员可以尝试使用TryUnsnap方法取消捕捉

Has a a 'Snapped' mode that a only a user can initiate. the developer can try to unsnap with the TryUnsnap method

没有快照模式,并且不推荐使用TryUnsnap.开发人员仍然可以监听窗口大小的变化,并知道应用程序视图是否像以前一样小.

Does not have Snapped mode, and TryUnsnap is deprecated. The dev can still listen for window size changes and know if the app view is in a smaller size as before.

引入了 ApplicationView.TryResizeView 方法,开发人员可以在其中尝试进行调整.窗口大小更改事件仍然存在.

Introduced the ApplicationView.TryResizeView method, where the dev can try to resize. Window size changed event is still there.

ApplicationView.GetForCurrentView().TryResizeView(new size(width, height)));

更多推荐

强制WinRT应用程序捕捉视图

本文发布于:2023-11-11 07:22:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577757.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   应用程序   WinRT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!