19
1
Option Strict On
2
Imports System
3
Public Module Module1
4
Public Sub Main()
5
'Create a new instance of the Foo class
6
Dim f As Foo = New Foo()
7
8
'Bind the BarChanged and FooChanged events to the f_ChainedEvent method
9
AddHandler f.BarChanged, AddressOf f_ChainedEvent
10
AddHandler f.FooChanged, AddressOf f_ChainedEvent
11
End Sub
12
Public Sub f_ChainedEvent(ByVal sender As Object, ByVal e As EventArgs)
13
'This will now execute when BarChanged or FooChanged is invoked
14
End Sub
15
End Module
16
Public Class Foo
17
Public Event FooChanged(ByVal sender As Object, ByVal e As EventArgs)
18
Public Event BarChanged(ByVal sender As Object, ByVal e As EventArgs)
19
End Class
Cached Result