title: How to dynamically add multiple Contents to an expander in WPF
body: <p>I have a method that adds multiple expanders in wpf, from the input of a combobox. After the combobox item is selected, a OpenFileDialog opens, and gets a filename.  This happens more than once, and I seem to be overwriting my Content for the expander.  Code below</p>
  
  <pre><code>private void comboBox_SetFileNames(object sender, SelectionChangedEventArgs e)
  {
      var selectedItem = combobox.SelectedItem as ComboBoxItem;
      if (selectedItem != null)
          string name = selectedItem.Name;
          Expander expander = new Expander {Header = name};
  
          Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
          dlg.DefaultExt = ".txt";
          dlg.Filter = "Text File (*.txt) | *.txt";
          Nullable&lt;bool&gt; result = dlg.ShowDialog();
  
          if (result == true)
          {
              expander.Content = new TextBlock() { Text = System.IO.Path.GetFileName(dlg.FileName) };
          }
  
          dlg.Filter = "Excel Files (*.xlsx) | *.xlsx";
          Nullable&lt;bool&gt; result2 = dlg.ShowDialog();
  
          if (result2 == true)
          {
              expander.Content = new TextBlock() { Text = System.IO.Path.GetFileName(dlg.FileName) };
          }
          dock.Children.Add(expander);
      }
  } 
  </code></pre>
  
  <p>Any way to have each of these file names listed below one another? so something like below</p>
  
  <pre><code>ExpanderName
  |
  ------FileName1.txt
  |
  ------FileName2.xlsx
  </code></pre>
  
  <p>Right now with it getting overwritten it looks like this:</p>
  
  <pre><code>ExpanderName
  |
  ------FileName2.xlsx
  </code></pre>