Update UI from background Thread
问题 This is just a curious question. Which one is the best way to update UI from another thread. First, this one: private delegate void MyDelegateMethod(); void MyMethod() { if (unknowncontrol.InvokeRequired) { this.BeginInvoke(new MyDelegateMethod(MyMethod)); return; } unknowncontrol.property = "updating!"; } On the other hand: Invoke((System.Threading.ThreadStart)delegate() { unknowncontrol.property = "updating!"; }); Or, is there a better way to do this? Of course this is for WinForms, for WPF