[UWP] [XAML]按下XAML全局元素 [英] [UWP][XAML]XAML Global element pressed

查看:93
本文介绍了[UWP] [XAML]按下XAML全局元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ElementSoundPlayer的引入意味着C#中的某个地方是一种拦截任何按UWP应用程序中默认元素的按压或聚焦事件的机制。有什么方法可以让我们访问它,这样我们可以做除了声音以外的其他事情。只是将侦听器附加到解决方案中的每个元素都不是很实际,因此访问相同的机制(或覆盖播放机制的能力)将是有帮助的

The introduction of ElementSoundPlayer implies that somewhere within C# is a mechanism to intercept any press or focus events targeted at default elements within UWP applications. Is there any way that we can get access to that so that we can do something other than sound. Just attaching a listener to every element within a solution isn't really practical so access to the same mechanism (or the ability to override the play mechanism) would be helpeful

推荐答案


嗨Nathan Hickling,


< span style ="font-size:10.5pt; font-family:'Segoe UI',sans-serif;颜色:#454545;背景:白色">>> ElementSoundPlayer的引入意味着C#中的某个地方是一种拦截任何按UWP应用程序中默认元素
的新闻或焦点事件的机制。


您是否正在寻找此文件:
声音?我不确定你在哪里找到了一种机制来拦截任何按UWP应用程序中默认元素的按或事件。你可以用b
来指出吗?

Are you looking for this document : Sound? I not sure where you found there is a mechanism to intercept any press or focus events targeted at default elements within UWP applications. Could you please point it out for me?


对于你的问题,一个可行的方法是您可以在需要时添加/删除页面所有控件上方的掩码,并订阅点击/触摸/单击掩码的
事件。将面具放在图层的顶部,它将拦截其他控件的交互。



最好的问候,


Roy


这篇关于[UWP] [XAML]按下XAML全局元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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