title: Looping through all comboboxes in wpf
body: <p>i am trying to create a simple WPF Application which just has comboboxes and a submit button.<br/>
  what i want to do is,<br/>
  when i click the button,<br/>
  my function should loop through all the Comboboxes and get their Content.<br/>
  <br/>
  My XAML -</p>
  
  <pre><code>&lt;ComboBox HorizontalAlignment="Left" Name="ComboBox2"  &gt; // the name goes from 2 to 50
    &lt;ComboBoxItem  IsSelected="True"&gt;Y&lt;/ComboBoxItem&gt;
    &lt;ComboBoxItem&gt;N&lt;/ComboBoxItem&gt;
    &lt;ComboBoxItem&gt;NA&lt;/ComboBoxItem&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>this is my onclick function<br></p>
  
  <pre><code>private void Submit(object sender, RoutedEventArgs e)
          {
              LinkedList&lt;String&gt; allnos = new LinkedList&lt;string&gt;();
              for (int i = 2; i &lt; 12; i++)
              {
                  ComboBoxItem Item = (ComboBoxItem)Combobox+"i"+.SelectedItem; // this will not work, how should i get it?
                  allnos.AddLast(Item.Content);
              }
          }
  </code></pre>
  
  <p>HOW DO I loop through all the comboboxes to get the selected values??
  Thanks in adv.</p>