title: Events and Delegates in c# : How to use Events & Delegates to Notify One class about changes in other class
body: <p>The question is below the proper way to use Events &amp; Delegates to call method of class <code>A:Show1()</code> using event of class B which is raised in <code>B:Show()</code></p>
  
  <pre><code>public class classA
  {
      private classB _Thrower;
  
      public classA()
      {
          _Thrower = new classB();            
          _Thrower.ThrowEvent += (sender, args) =&gt; { show1(); };
      }
  
      public void show1()
      {
          Console.WriteLine("I am class 2");
      }
  }
  
  public class classB
  {
      public delegate void EventHandler(object sender, EventArgs args);
  
      public event EventHandler ThrowEvent = delegate { };
      public classB()
      {
          this.ThrowEvent(this, new EventArgs());
      }
      public void show()
      {
          Console.WriteLine("I am class 1");            
      }
  }
  </code></pre>
  
  <p>Sorry for any mistakes in question this is my first time of stackoverflow </p>