title: change textbox value depending on combobox selected item
body: <p>I'm trying to make my c#, wpf application change the value in a textbox accordingly with the value in a combobox using 'IF' statements.</p>
  
  <p>The idea is that if the Gender combobox has 'Male' selected, then the sex.Text should show 'm'. 
  If Gender has 'Female' selected then sex.Text should show 'f'. But unfortunately the sex textbox will show nothing on the first selection. But afterwards, it keeps showing the opposite of what I want it to. E.g when I select female it displays 'm' and vice-verse, as if it's having a case of delayed action.</p>
  
  <p>Here's the event:</p>
  
  <pre><code>    private void gender_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          if (gender.Text == "Male")
          {
              sex.Text = "m";
          }
          if (gender.Text == "Female")
          {
              sex.Text = "f";
          }
      }
  </code></pre>
  
  <p>Any clue on how to make this work?</p>
  
  <p>I'm guessing this may have something to do with the winforms SelectedIndexChanged event being replaced by the SelectionChanged as it's wpf equivalant.</p>
  
  <p>Clearly I just may not know how to use it.</p>
  
  <p>Help much appreciated.</p>