title: How to change a Point struct property while its in a List?
body: <p>I have the following code:</p>
  
  <pre><code>for (int i = 0; i &lt; 10000; i++ )
  {
      list.Add(new Point(i, 3));
  }
  
  for (int i = 0; i &lt; 10000; i++)
  {
      list[i].X = 100;
  }
  
  Point point = new Point(0, 1);
  point.X = 1;
  point.Y = 10;
  </code></pre>
  
  <p>When I try to change X or Y property of a newly created Point structure there is no problem:</p>
  
  <pre><code>Point point = new Point(0, 1);
  point.X = 1;
  point.Y = 10;
  </code></pre>
  
  <p>But when I'm trying to do the same in a loop</p>
  
  <pre><code>for (int i = 0; i &lt; 10000; i++)
  {
      list[i].X = 100;
  }
  </code></pre>
  
  <p>The compiler is telling me</p>
  
  <blockquote>
    <p>Cannot modify the return value of
    <code>System.Collections.Generic.List&lt;System.Windows.Point&gt;.this[int]</code>
    because it is not a variable</p>
  </blockquote>
  
  <p>Can anybody please explain me this.</p>