WPF等待或光标等待像行为 [英] wpf waiting or cursor waiting like behavior

查看:102
本文介绍了WPF等待或光标等待像行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,有一些耗时的过程,因此我想显示一个对话或动画,并在过程结束后将其关闭.

谁能为我提供有用的提示或有关该操作的链接?

In my application ,there is some time consuming process, so I want to show a dialogue or animation and close it once the process is over.

could anyone provide me a useful tip or links about how to do that?

thanks in advance!

推荐答案

看看这篇有用的文章-
have a look at this useful article - WPF Multithreading: Using the BackgroundWorker and Reporting the Progress to the UI.[^].
You basically need to do something similar when the UI is doing background processing for a long time.


它的作用与winforms相同,显示无模式对话框,将光标设置为等待光标,完成后关闭对话框.进度条是可选的.您可以根据需要设置要运行的WPF动画,但是WPF内置的任何东西都不显示动画GIF.当然,如果愿意,您可以在媒体播放器控件中显示一个wmv,但这对我来说似乎太过分了.
It works the same as in winforms, show a modeless dialog, set the cursor to a wait cursor, close the dialog when you''re done. A progress bar is optional. You can set up a WPF animation to run if you want to, but WPF has nothing built in that I know of to show animated GIFs. Of course, you can show a wmv in the media player control, if you like, but that seems like overkill to me.


这篇关于WPF等待或光标等待像行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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