title: How to create an array of labels in wpf?
body: <p>I am trying to simulate LED indicators in my WPF App (around 16). I get 2 bytes from serial port, and based on the bits, I need to turn ON/OFF the LED indicators on my App window.
  Example: 0xFF, 0xFE => all but the last LED are ON.
  I am using labels with a dark background color to indicate an OFF LED, and a bright background color for an ON LED.
  If I have an array of labels, then I could possibly do something like this:</p>
  
  <pre><code>for(i = 0; i &lt; 16; i++)
  {
    if(bitArray[i] == true)
      lblLED[i].Background = Brushes.Pink;
    else
      lblLED[i].Background = Brushes.Maroon;
  }
  </code></pre>
  
  <p>Any suggestions on whats the best way to do this? A sample code which can show how this would work will be helpful. Thanks!</p>