I guess I'm confused. When you setup an event handler on a BO, it is BO specific normally, unless you are sharing the event handler. I.e. if you have two BOs on the form, PrimaryBO and NotSoPrimaryBO, then when you setup event handlers, it is specific to the BO:
// C#. primaryBO_Navigated and notSoPrimaryBO_Navigated are methods in the form class.
PrimaryBO.Navigated += primaryBO_Navigated;
NotSoPrimaryBO.Navigated += notSoPrimaryBO_Navigated;
' VB. Two choices:
AddHandler PrimaryBO.Navigated, AddressOf primaryBO_Navigated
AddHandler NotSoPrimaryBO.Navigated, AddressOf notSoPrimaryBO_Navigated
' Or directly at the method:
Private Sub primaryBO_Navigated(e As NavigatedEventArgs) Handles PrimaryBO.Navigated
' handle primary BO stuff
End Sub
Private Sub notSoPrimaryBO_Navigated(e As NavigatedEventArgs) Handles NoSoPrimaryBO.Navigated
' handle not so primary bo stuff
End Sub
So, you'd always know the BO, because the code will only react to the navigation on the BO that it is subscribing to.
Now if you are sharing the event handler for both, then, you'd have a problem...but one that is easily fixed. Put the shared code in a private method, with an argument that is the BO being used. Then just use two event handlers to call the common method:
' Common method that does work, based on BO
Private Sub NavigatedHandler(bo As BusinessLayer)
' Test on BO type to figure out what to do
If bo.GetType() Is Me.PrimaryBO.GetType() Then
End If
End Sub
' Use two event handlers that call the common method
Private Sub primaryBO_Navigated(e As NavigatedEventArgs) Handles PrimaryBO.Navigated
Me.NavigatedHandler(Me.PrimaryBO)
End Sub
Private Sub notSoPrimaryBO_Navigated(e As NavigatedEventArgs) Handles NoSoPrimaryBO.Navigated
Me.NavigatedHandler(Me.NotSoPrimaryBO)
End Sub
Hope that helps!