什麼是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