什么是MethodInvoker在WPF
在windows form
替代我使用此代码MethodInvoker在WPF
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,它会很棒
编辑:
个未知字符
看到这里http://stackoverflow.com/questions/1644079/how-can-i-use-the-dispatcher-调用功能于WPF的变化控制从 - 非主线程和这里http://stackoverflow.com/questions/19009174/dispatcher-invoke-vs-begininvoke-confusion – dbc 2014-12-13 19:32:41
另外这里:HTTP:// MSDN。 microsoft.com/en-us/library/system.windows.threading.dispatcher.invoke%28v=vs.110%29.aspx – dbc 2014-12-13 19:33:51
我看到所有的回答的问题,但我没有找到我的情况 – 2014-12-14 07:34:20