I discovered that an event raised (directly on indirectly) in the constructor cannot be handled outside the very class. To prove if that was the actual problem, I wrote a simple exemplary app.
Class with the event:
Namespace Utils
Public Class A
Public Event Test()
Public Sub New()
CallTest()
End Sub
Public Sub MakeACall()
CallTest()
End Sub
Private Sub CallTest()
RaiseEvent Test()
End Sub
End Class
End Namespace
Main form (handling event properly):
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
m_A.MakeACall()
End Sub
Private Sub HandleTest() Handles m_A.Test
MsgBox("ta-dah!")
End Sub
Protected WithEvents m_A As New Utils.A()
End Class
Main form (NOT handling event properly):
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
m_A = New Utils.A()
End Sub
Private Sub HandleTest() Handles m_A.Test
MsgBox("ta-dah!")
End Sub
Protected WithEvents m_A As Utils.A
End Class
The reason of such behavior became quite obvious after writing those pieces, but maybe there is a way to omit it?