什么是推荐的方式在WPF执行异步任务? [英] What is recommended way to perform async tasks in WPF?

查看:467
本文介绍了什么是推荐的方式在WPF执行异步任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有标准工具,或异步任务执行推荐的方法?

Are there any standard tools, or recommended approaches for async tasks execution?

UPD我明白了,如何使用线程。我只需要知道推荐WPF的方式来阻止用户界面,同时执行异步调用,以及如何更新进度信息。

UPD I understand, how to use threads. I only need to know the recommended WPF way to block UI while performing async call, and how to update progress info.

推荐答案

您可以使用多种方法,例如:

You can use several ways, for example:

  • Thread pool
  • Background Worker
  • Plain old threads

而自从.NET 4中,preferred方法是使用任务

And since .NET 4, the preferred way is to use Tasks.

这篇关于什么是推荐的方式在WPF执行异步任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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