title: VB - Raising events from another class correctly
body: <p>I know there is a lot of information regarding the above, but I do not grasp how to do this correctly, so I thought using a real life problem may help to click  it for me and others.</p>
  
  <p>So in class A I have defined an event method</p>
  
  <pre><code>Public Sub textChangedMethod(ByVal textedChanged As Boolean)
    ' do some code on properties of this class only
  End Sub
  </code></pre>
  
  <p>What I need to happen is I need some other class to raise this method, </p>
  
  <p>I have a concept but its totally wrong. </p>
  
  <p>At the moment I pass an instance of class A to the another class so it can reference the event (<strong>this must be wrong</strong>)</p>
  
  <pre><code>Dim UI As New newClassDialog(Me) 'class A
  </code></pre>
  
  <p>In this new class I have the event handler</p>
  
  <pre><code>Public Event textChanged(ByVal textedChanged As Boolean)
  </code></pre>
  
  <p>So in the constructor of the new class I can now add the handler</p>
  
  <pre><code>Public Sub New(ByRef classA As Class A)
  
     ' This call is required by the designer.
     InitializeComponent()
  
     AddHandler textChanged, AddressOf classA.textChangedMethod
  
  End Sub
  </code></pre>
  
  <p>Now of course I can raise the event like so</p>
  
  <pre><code>RaiseEvent textChanged(True)
  </code></pre>
  
  <p>Basically passing in the class seems ridiculous in my eyes, so using this example is there a 'proper' way of doing this? </p>
  
  <p>Thanks</p>