C#WPF - 线程(回调方法) - 调度程序 [英] C# WPF -- Thread (Callback method) -- Dispatcher

查看:451
本文介绍了C#WPF - 线程(回调方法) - 调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我正在寻找一个解释为什么必须编程这么复杂。

我无法更新用户文本控件。 Google意味着较低的代码。
Hello!
I am looking for an explanation why this has to be programmed so complicated.
I cannot update the user text control. Google meant the lower code.

推荐答案

嗨Markus,

Hi Markus,

根据您的描述,您想要更新UI在另一个帖子中, 

According to your description, you want to update UI in another thread, 

我使用过方法" BeginInvoke "使用Dispatcher,因为" Dispatcher.BeginInvoke schedule 
给定的操作在UI线程中执行,然后返回控制以允许当前线程继续执行。
I have used method "BeginInvoke" with Dispatcher because "Dispatcher.BeginInvokeschedules the given action for execution in the UI thread and then returns control to allow the current thread to continue executing.


这篇关于C#WPF - 线程(回调方法) - 调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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