title: Struggling with C# Events examples
body: <p>I'm struggling to implement some Events into some code I'm working on, and the examples provided in the textbook I'm working through don't compile (C# Player's Handbook, 3rd Edition). I've been trying to figure out what I'm not getting about Events/Event Handlers, etc. to no avail. </p>
  
  <p>I'm using Microsoft Visual Studio (most recent update), and this is the code I'm trying to make work (I didn't write it -- but I think figuring out why it won't work will help me with the other Event problems I'm having).</p>
  
  <pre><code>namespace EventsPractice
  {
      class Program
      {
          static void Main(string[] args)
          {
              Point point = new Point();
  
              point.PointChanged += HandlePointChanged;
          }
  
      }
      class Point
      {
          private double x;
          private double y;
  
          public double X
          {
              get { return x; }
              set
              {
                  x = value;
                  OnPointChanged();
              }
          }
          public double Y
          {
              get { return y; }
              set
              {
                  y = value;
                  OnPointChanged();
              }
  
          }
  
          public event EventHandler PointChanged;
  
          public void OnPointChanged()
          {
              if (PointChanged != null)
                  PointChanged(this, EventArgs.Empty);
          }
  
          public void HandlePointChanged(object sender, EventArgs eventArgs)
          {
              // Do something Here
          }
  
      }
  }
  </code></pre>
  
  <p>The problem is that on the line  </p>
  
  <pre><code>point.PointChanged += HandlePointChanged;
  </code></pre>
  
  <p>I am getting the error 'The name HandlePointChanged does not exist in this context.'</p>
  
  <p>Am I missing something obvious? Why won't this work?</p>
  
  <p>Thanks in advance!</p>