Option Strict to
On (Because I want to convert all this code from VB to C#) and there's this one situation I can't figure out. Here is a snippet of the code:
Private Sub MessageClicked(sender As Object, e As MouseButtonEventArgs) Dim obMenuItem = e.OriginalSource If obMenuItem.Tag IsNot Nothing Then Dim Message = MessageCollection.FirstOrDefault(Function(i) i.ID = obMenuItem.Tag.ToString) If Message.Outbound = False AndAlso Message.ReadBy = "" Then MarkAsRead(SelectedTractor, obMenuItem.Tag.ToString) End If End Sub
The error arises any time time I try to use
obMenuItem after it's been declared. I know I need to initialize it using the
As phrase, but I don't know what I'm supposed to initialize it as.
MouseButtonEventArgs, but neither of those have the
.tag I'm trying to access.