title: Sort a 2D Points List (first by X and then Y)
body: <p>I am trying to sort a List of 2D Points first by x co-ordinate and then by y co-ordinate.
  I implemented the IComparer interface as follows:</p>
  
  <pre><code>class PointComparer : IComparer&lt;Point&gt;
  {
      public int Compare(Point x, Point y)
      {
          if (x.Y != y.Y)
          {
              return x.Y - y.Y;
          }
          else
          {
              return x.X - y.X;
          }
  
      }
  }
  </code></pre>
  
  <p>And then call my sorting as follows: </p>
  
  <pre><code>pointsList.Sort(new PointComparer());
  </code></pre>
  
  <p>For some reason the list doesn't sort. Surely is something very simple and silly, but stuck on this for quite a while....TIA</p>