title: How to loop through UIElement in a List<UIElement>?
body: <p>I have a List that contains a <code>Canvas</code> which contains also some <code>UIElement</code> as follow:</p>
  
  <pre><code>List&lt;Canvas&gt; cvList = new List&lt;Canvas&gt;();
  Canvas cv = new Canvas();
  cv.Width = 100;
  cv.Height = 100;
  Button btn = new Button();
  btn.Content = "OK";
  cv.Children.Add(btn);
  cvList.Add(cv);
  </code></pre>
  
  <p>The array size of <code>Canvas</code> is dynamic and immmutable, which is the reason I use List instead of <code>Array</code>. </p>
  
  <p>My question is if I were to modify properties of one <code>UIElement</code> (i.e. Button.Content), how could I access the <code>Button</code> properties? If it was an Array I could simply loop through the array and find an index that matches, like below:</p>
  
  <pre><code>Canvas[] cv = new Canvas[myInt];
  Button[] btn = new Button[myInt];
  for (int i = 0; i&lt;myInt; i++)
  {
  cv[i] = new Canvas();
  btn[i] = new Button();
  btn[i].Content = "OK";
  cv[i].Children.Add(btn[i]);
  }
  btn[5].Content = "Not OK";
  </code></pre>
  
  <p>but how could I do so for an UIElement that is in a List?</p>
  
  <pre><code>List&lt;UIElement&gt;[int].UIElement.Properties
  </code></pre>