Handling public property's events from consumer

DannyT

Freshman
Joined
Apr 14, 2005
Messages
36
I have an MDI form i'm using as an Application class

This application "has a" login form as a private property which is exposed to a consuming application controller class via a public getter.

I want my controller to handle a login event raised by the login form, however I cannot seem to handle events of the login form as a property of the application?

E.g. (pseudo code)
Visual Basic:
Public Class Application
    private controller as Controller
    private login as LoginForm

    Public ReadOnly Property UserLoginForm() As LoginForm
        Get
            Return Me.login
        End Get
    End Property

    Private Sub Application_Load() Handles MyBase.Load
        Me.controller = controller.GetInstance
        Me.controller.RegisterApp(Me)
        RaiseEvent AppLaunched()
    End Sub

End Class

Public Class Controller
    Private Property withevents viewRef as Application

    Public Sub new(app as Application)
        me.viewRef = app
    End Sub
 
    Public Sub GetInstance() As Controller
        'singleton code
    End Sub

    '**********THE PROBLEM CODE***********
    Public Sub UserLogin() Handles viewRef.UserLoginForm.loginEvent  'can't access UserLoginForm's events???
        'do something with a command
    End Sub

End Class
The problem is my UserLogin function on the controller can't seem to access the Applications UserLoginForm property to handle it's events.

Hope that makes some sort of sense and someone can help?
 
Last edited by a moderator:
Back
Top