以下代码产生 ArgumentNullException:
Public Custom Event PlayerDetailRequested As RoutedPropertyChangedEventHandler(Of Player)
AddHandler(ByVal value As RoutedPropertyChangedEventHandler(Of Player))
Me.AddHandler(PlayerDetailRequestedEvent, value)
End AddHandler
RemoveHandler(ByVal value As RoutedPropertyChangedEventHandler(Of Player))
Me.RemoveHandler(PlayerDetailRequestedEvent, value)
End RemoveHandler
RaiseEvent(ByVal sender As Object, ByVal e As RoutedPropertyChangedEventArgs(Of Player))
Me.RaiseEvent(e)
End RaiseEvent
End Event
Public Shared ReadOnly PlayerDetailRequestedEvent As RoutedEvent = _
EventManager.RegisterRoutedEvent("PlayerDetailRequested", _
RoutingStrategy.Bubble, _
GetType(RoutedPropertyChangedEventHandler(Of Player)), GetType(PlayersManagementControl))
Private Sub Hyperlink_Click(sender As Object, e As RoutedEventArgs)
RaiseEvent PlayerDetailRequested(Me, New RoutedPropertyChangedEventArgs(Of Player)(SelectedPlayer, SelectedPlayer))
End Sub
调用时抛出异常Me.RaiseEvent(e)
在 VB 中很难找到工作示例,而 C sharp 的事件处理不同。请帮助我保持理智!