Hi all,
This sub works fine:
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
But this function doesn't:
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
How do I return my listitem in above function?
Thanks!!!!!
:) Mojo