Monday, May 13, 2013

The equivalent to InvokeRequired in WPF


In WPF, this was moved out of the Control/UIElement hierarchy, and into the dispatcher.
The equivalent is Dispatcher.CheckAccess and Dispatcher.Invoke.
You should be able to do:
if (someControl.Dispatcher.CheckAccess())
      UpdateUI();
else
    someControl.Dispatcher.Invoke(new Action(UpdateUI));

No comments:

Post a Comment