Этот саб отлично работает:
Private Sub UpdateInfo(ByVal text As String, ByVal timeStamp As DateTime)
If Me.lstStatus.Dispatcher.Thread Is System.Threading.Thread.CurrentThread Then
' Do stuff with
Else
Me.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, New Action(Of String, DateTime)(AddressOf UpdateInfo), text, timeStamp)
End If
End Sub
Но эта функция не:
Private Function UpdateInfo(ByVal text As String, ByVal timeStamp As DateTime) As ListItem
If Me.lstStatus.Dispatcher.Thread Is System.Threading.Thread.CurrentThread Then
Dim l As New ListItem
' Do stuff with
Return l
Else
Me.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, New Action(Of String, DateTime)(AddressOf UpdateInfo), text, timeStamp)
' Above line doesn't return anything??
End If
End Function
Как мне вернуть мой список в функции выше?
Спасибо !!!!!
:)
Mojo