Here is the Interface
Public Interface ILoginConductor
Inherits IHandle(Of LoginEvent)
Inherits IHandle(Of LogoutEvent)
Inherits IHandle(Of ExitEvent)
End Interface
In C# here is the method that uses the interface
public void Handle(LoginEvent message)
{
LoginWindow loginWindow = new LoginWindow();
loginWindow.Login += new EventHandler<LoginEventArgs>(this.LoginWindow_Login);
loginWindow.Cancel += new EventHandler(LoginWindow_Cancel);
loginWindow.ShowDialog();
}
And it converts to this in VB.Net
Public Sub Handle(message As LoginEvent) Implements ILoginConductor.Handle
Dim loginWindow As New LoginWindow()
loginWindow.Login += New EventHandler(Of LoginEventArgs)(AddressOf Me.LoginWindow_Login)
loginWindow.Cancel += New EventHandler(AddressOf LoginWindow_Cancel)
loginWindow.ShowDialog()
End Sub
But the compiler throws a error which says that I must use a RaiseEvent
. Could someone please help me to show me how to fix my code.