title: How do I set an object's identifier to the content of a string?
body: <p>I am making a hangman app in UWP. I would like to create a number of rectangles equal to the length of the word (for the bars underneath the letters). I already have a loop that creates a number of columns equal to the length of the word. Unlike the columns, the rectangles I create will need to have identifiers so I can set their properties. Is it possible to set the rectangles' identifiers to Bar1, Bar2, etc. by setting them to the content of a string? Here's what I imagine:</p>
  <pre><code>for (int counter = 0; counter &lt; stupidWord.Length; counter++)
  {
      WordGrid.ColumnDefinitions.Add(new ColumnDefinition());
      string barName = &quot;Bar&quot; + counter;
      Rectangle barName = new Rectangle();
  }
  </code></pre>
  <p>The rectangles' identifiers would be whatever barName is equal to at the time of their construction.</p>