如何冻结用户界面几秒钟? [英] How to freeze the UI for few seconds?

查看:125
本文介绍了如何冻结用户界面几秒钟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建Windows Phone 7应用程序.我想冻结UI几秒钟.我应该使用计时器吗?调用Thread.sleep()方法不能给出正确的结果.我应该使用哪个计时器?有人可以给出适当的解释吗?

I am creating a windows Phone 7 application. I want to freeze the UI for a few seconds. Should I use a timer? Calling the Thread.sleep() method isn''t giving the proper result. Which timer should I use? Can someone give proper explanation?

推荐答案

如果我没有被误解,则希望在两次操作之间稍加延迟.

为此,请使用DispatcherTimer.

看看下面的链接.
http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.aspx#Y0

http://social.msdn.microsoft.com/Forums/是/windowsphone7series/thread/a7509566-7d13-483e-bf3a-3ce22dcba1f6
If I am not misunderstood, you want to put some delay between your Operations.

For this in WP7 Programming, use DispatcherTimer.

Have a look at below links.
http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.aspx#Y0

http://social.msdn.microsoft.com/Forums/is/windowsphone7series/thread/a7509566-7d13-483e-bf3a-3ce22dcba1f6


您是否可以禁用GUI上的所有控件一段时间?不想进行任何UI交互并将简单的请稍候"放在GUI上?
Can you not just disable all your controls on the GUI for the amount of time you don''t want any UI interactions and place a simple "Please Wait" thingy on the GUI?


您为什么要这样做?通常,问题不是冻结UI ...
您为什么要故意让用户认为手机无故崩溃了?
Why would you want to do that? Normally, the problem is not freezing the UI...
Why would you want to deliberately let the user think the phone has crashed for no good reason?


这篇关于如何冻结用户界面几秒钟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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