출처 : http://bulkdisk.tistory.com/78
public delegate void ShowButtonDelegate(bool IsShow); public void ShowButtonCaller(bool IsShow) { if (canvasButtonGroup.Dispatcher.CheckAccess()) ShowButtonBody(IsShow); else Dispatcher.Invoke(new ShowButtonDelegate(ShowButtonBody), IsShow); } private void ShowButtonBody(bool IsShow) { DebugWrite("ShowButtonBody =" + IsShow.ToString());------------------------------------
}
윈폼 ----------------------------
this.Invoke(new MethodInvoker(delegate() { mnuConnectServer.Enabled = true; mnuStartServer.Enabled = true; }));------------------------------------
WPF ----------------------------
MainUI.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
new DispatcherOperationCallback(delegate { MainUI.ResetGame(user.m_nID); return null;
}), null);
------------------------------------
Invoke : 동기
BeginInvoke : 비동기
------------------------------------