title: Selection change/add items with ComboBox in WPF
body: <p>Simple questions can be the hardest sometimes. 3 things I am trying to understand;
  1. Allow a selection change within a combobox to help populate items in 2nd combobox.
  2. Clear items in 2nd box before populating items.
  3. Adding items in 2nd box.</p>
  
  <p>Note that this code worked on my WinForms code, but I am trying to convert it to WPF and understand that code.</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;ComboBox Name="ComboBox_Location" HorizontalAlignment="Left" Margin="170,56,0,0" VerticalAlignment="Top" Width="160"&gt;
          &lt;ComboBoxItem Content="Hospital"/&gt;
  &lt;/ComboBox&gt;
  &lt;ComboBox Name="ComboBox_Printer" HorizontalAlignment="Left" Margin="30,131,0,0" VerticalAlignment="Top" Width="300"/&gt;
  
  $ComboBox_Location.add_SelectionChanged{
  
      switch ($ComboBox_Location.SelectedItem){
  
          "Hospital"{
              $ComboBox_Printer.Items.Clear();
              $Hospital = Get-Printer -ComputerName \\bmh01-print01 | where {($_.Name -like “*BMH01*”) -and ($_.DeviceType -eq "Print")}
              foreach($Name in $Hospital){
              $ComboBox_Printer.Items.Add("$($Name.name)");
              }
          }
      }
  </code></pre>
  
  <p>Thank you in advance! And if any of you have a website or cite I could go to to see the specific coding for WPF, any help will be appreciated!</p>