WPF中的MethodInvoker?

Bri*_*rij 7 .net wpf winforms

有没有像任何内置的委托System.Windows.Forms.MethodInvokerWPF

我是从移植一些功能WinFormsWPF,为了这个,我没有wising进口的WinForms参考,是否有任何相应的委托WPF

Meh*_*nce 10

你可以像这样使用;

Dispatcher.BeginInvoke(new Action(delegate
  {
    // Do your work
  }));
Run Code Online (Sandbox Code Playgroud)


Ale*_*lex 6

MethodInvoker也用于WPF.您可以在Dispatcher.Invoke或Control.Invoke方法中使用它.您也可以使用具有许多覆盖的Action委托.他们都会很有效率.

  • `MethodInvoker还存在于WPF中,什么命名空间? (4认同)