使用Deployment.Current.Dispatcher.BeginInvoke的是什么(()=> {...})? [英] What is the use of Deployment.Current.Dispatcher.BeginInvoke( ()=> {...} )?

查看:321
本文介绍了使用Deployment.Current.Dispatcher.BeginInvoke的是什么(()=> {...})?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了一些代码此Deployment.Current.Dispatcher.BeginInvoke(()=> {...})格式。是它用来做背景中的一些工作?它有哪些一般用途?

I have seen this Deployment.Current.Dispatcher.BeginInvoke( ()=> {...} ) format in some code .Is it used to do some work in Background?What are the general uses of it?

推荐答案

没有,它不是在一个的背景的线程做的工作 - 这是做对的 UI 的线程。因此,它通常名为的从后台线程,为了操纵UI,它只能在UI线程来完成。

No, it's not to do work in a background thread - it's to do work on the UI thread. So it's normally called from a background thread, in order to manipulate the UI, which can only be done on the UI thread.

正文lambda表达式是要在UI线程来执行代码。

The body of the lambda expression is the code which you want to execute in the UI thread.

这篇关于使用Deployment.Current.Dispatcher.BeginInvoke的是什么(()=> {...})?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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