如何在 WP8 中以编程方式关闭 MessageBox? [英] How To Close MessageBox Programmatically in WP8?
问题描述
我知道已经有问题 有关以编程方式关闭 MessageBox 的问题.但解决这些问题的方法是使用计时器.
I'm aware that there are already questions questions asked regarding closing a MessageBox programmatically . But the solution to those questions is to use a timer.
我正在尝试开发一个 NFC 应用程序,因此当我创建一个 MessageBox 时,它包含一条消息 请点击您的 NFC
.所以从技术上讲,计时器没有帮助.我需要一种方法来关闭或处理 MessageBox.
I am trying to develop an NFC application, so when i create a MessageBox, it contains a message Please Tap Your NFC
. So technically, the Timer isn't helpful. I need a way to close or dispose a MessageBox.
请指教.
推荐答案
您可以按照您链接的问题中的描述自行创建自定义窗口.但是,您可以使用 Hide
方法代替计时器,一旦 NFC 连接事件发生,您就可以调用该方法.
You can create a custom window yourself as described in the question you linked. However, instead of a timer you can and include a Hide
method which you can call once NFC connection event occurs.
或者,您可以获取 Coding4Fun 工具包 并使用已经包含的 MessagePrompt
类一个隐藏方法.
Alternatively, you could get Coding4Fun toolkit and use MessagePrompt
class which already includes a Hide method.
这篇关于如何在 WP8 中以编程方式关闭 MessageBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!