我想知道,在调用 Dispatcher.Invoke 时,调用线程是否会等到调度程序完成其操作......?
例如:
new Thread(() =>
{
string x = "Yes.";
// Invoke the dispatcher.
Dispatcher.Invoke((Action)delegate()
{
// Get the string off a UI element which contains the text, "No."
x = textBox.Text;
});
// Is x either ("Yes" or "No") here, or always "No"?
}).Start();