Wpf 在Dispatcher.Invoke中传递两个参数

Wpf 在Dispatcher.Invoke中传递两个参数,wpf,vb.net,dispatcher,Wpf,Vb.net,Dispatcher,我正在尝试从另一个线程更新两个UI: Me.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Normal, New Action(AddressOf RefreshDisplay)) 问题是我需要传递两个参数来刷新显示 您需要使用与目标方法匹配的委托类型。这不可能是Action,这是一个不带参数的方法的委托。修正: Me.Dispatcher.Invoke(Windows.Threading.DispatcherPriori

我正在尝试从另一个线程更新两个UI:

Me.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Normal, New Action(AddressOf RefreshDisplay))
问题是我需要传递两个参数来刷新显示


您需要使用与目标方法匹配的委托类型。这不可能是Action,这是一个不带参数的方法的委托。修正:

    Me.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Normal, _
                         New Action(Of String, String)(AddressOf RefreshDisplay), _
                         "foo", "bar")
别忘了实际传递这两个论点,我当然不得不猜测它们

    Me.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Normal, _
                         New Action(Of String, String)(AddressOf RefreshDisplay), _
                         "foo", "bar")