title: ForEach loop not changing property of class
body: <p>I've seen a couple questions about this, and done some research.</p>
  
  <p>My understanding is that when you run a foreach on IEnumerable: if T is a Reference Type (e.g. Class) you should be able to modify properties of the object from within the loop. If T is a value type (e.g. Struct) this would not work since the iteration variable would be a local copy.</p>
  
  <p>I am working on a Windows Store app with the following code:</p>
  
  <p>My Class:</p>
  
  <pre><code>public class WebResult
  {
      public string Id { get; set; }
      public string Title { get; set; }
      public string Description { get; set; }
      public string DisplayUrl { get; set; }
      public string Url { get; set; }
      public string TileColor
      {
          get
          {
              string[] colorArray = { "FFA200FF", "FFFF0097", "FF00ABA9", "FF8CBF26",
              "FFA05000", "FFE671B8", "FFF09609", "FF1BA1E2", "FFE51400", "FF339933" };
              Random random = new Random();
              int num = random.Next(0, (colorArray.Length - 1));
              return "#" + colorArray[num];
          }
      }
      public string Keywords { get; set; }
  }
  </code></pre>
  
  <p>The Code:</p>
  
  <pre><code>IEnumerable&lt;WebResult&gt; results = from r in doc.Descendants(xmlnsm + "properties")
                                   select new WebResult
                                   {
                                       Id = r.Element(xmlns + "ID").Value,
                                       Title = r.Element(xmlns + "Title").Value,
                                       Description = r.Element(xmlns +
                                                         "Description").Value,
                                       DisplayUrl = r.Element(xmlns + 
                                                        "DisplayUrl").Value,
                                       Url = r.Element(xmlns + "Url").Value,
                                       Keywords = "Setting the keywords here"
                                   };
  
  foreach (WebResult result in results)
  {
      result.Keywords = "These, are, my, keywords";
  }
  
  if (control is GridView)
  {
      (control as GridView).ItemsSource = results;
  }
  </code></pre>
  
  <p>Once the results get displayed the "Keywords" property is "Setting the keywords here". If I put a break point in the foreach loop I can see that the results object is not getting modified...</p>
  
  <p>Any ideas as to what is going on? Am I just missing something obvious? Does IEnumerable behave differently in .NET For Windows Store Apps?</p>