Getting event subsription to work in VB?

Oct 8, 2008 at 4:04 PM
Hi all, I'm having an issue getting event subsription to work in VB, more so the action parameter and it's handler.

fundAddedEvent.Subscribe(FundAddedEventHandler, ThreadOption.UIThread, true);

        void FundAddedEventHandler(FundOrder fundOrder)
            Debug.Assert(View != null);

What should this look like in VB including FundAddedEventHandler?

Many thanks.
Oct 8, 2008 at 6:36 PM



The matching code in VB would be:


fundAddedEvent.Subscribe(AddressOf FundAddedEventHandler, ThreadOption.UIThread, True)


Sub FundAddedEventHandler(ByVal fundOrder As FundOrder)

    Debug.Assert(View IsNot Nothing)


End Sub


You may also express a condition for the subscription with a lambda expression as follows:


fundAddedEvent.Subscribe(AddressOf FundAddedEventHandler, ThreadOption.UIThread, True, Function(fundOrder) fundOrder.CustomerId = "Customer1")


Please, let me know if this helps.


Ignacio Baumann Fonay