【发布时间】:2014-12-15 02:59:53
【问题描述】:
wpf 中 MethodInvoker 的替代方案是什么
在windows form我使用这个代码
private void msg()
{
if (this.InvokeRequired)
this.Invoke(new MethodInvoker(msg));
else
textBox1.Text = textBox1.Text + Environment.NewLine + " >> " + readData;
在 WPF 中,我使用 Dispatcher.CheckAccess() 而不是 this.InvokeRequired,但 wpf 中没有 Dispatcher.MethodInvoke() 或 Dispatcher.Inovke.MethodInvoke()
如果有人将 mycode 转换为 WPF,那就太好了
编辑:
未知字符
【问题讨论】:
-
我看到了所有已回答的问题,但我没有找到适合我的案例的正确答案
标签: c# wpf multithreading