How to programmatically respond to Snap in Windows 8 Metro(如何在 Windows 8 Metro 中以编程方式响应 Snap)
问题描述
有没有办法在 Metro 应用程序中响应 C# 中的 Snap?当其中一页被捕捉时,我需要显示另一页.我的想法是通过导航到另一个页面来响应 snap.
Is there a way to respond to Snap in C# in a Metro app? When one of the pages is snapped I need to show another one. My idea is to respond to snap by naviating to another page.
我找到了
var currentView = ApplicationLayout.GetForCurrentView();
currentView.LayoutChanged += new TypedEventHandler<ApplicationLayout, ApplicationLayoutChangedEventArgs>(currentView_LayoutChanged);
但它似乎不再适用于 Consumer Preview.还有其他方法吗?
but it looks like it no longer works in Consumer Preview. Is there another way?
推荐答案
在 Consumer Preview 中,您需要对不同的事件做出反应.现在是 ViewStateChanged,而不是 LayoutChanged.
In Consumer Preview you need to react to a different event. It's ViewStateChanged now, not LayoutChanged.
这篇关于如何在 Windows 8 Metro 中以编程方式响应 Snap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Windows 8 Metro 中以编程方式响应 Snap
基础教程推荐
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
