title: WPF Combo Box Data Binding Selected Item
body: <p>I am trying to databind a <code>ComboBox</code> to a list of <code>strings</code>. So far I have got the following:</p>
  
  <p>In my View I have:</p>
  
  <pre><code>&lt;ComboBox Height="23" 
            HorizontalAlignment="Left" 
            Margin="133,180,0,0" 
            Name="comboBox1" 
            ItemsSource="{Binding Hours}" 
            VerticalAlignment="Top" 
            Width="38" /&gt;
  </code></pre>
  
  <p>And in my ViewModel I have:</p>
  
  <pre><code>private List&lt;string&gt; tripTimeHours = new List&lt;string&gt;();
  private List&lt;string&gt; tripTimeMinutes = new List&lt;string&gt;();
  
  public CreateTripViewModel()
  {
      TripName = new DataWrapper&lt;string&gt;(this, tripNameChangeArgs);
      TripName.IsEditable = true;
      setObjects();
      CreateTripFiredCommand = new SimpleCommand&lt;object, EventToCommandArgs&gt;(ExecuteCreateTripCommand);
  }
  
  private void setObjects()
  {
      for (int i = 0; i &lt; 24; i++)
      {
          tripTimeHours.Add(i.ToString());
      }
  
      for (int i = 0; i &lt; 60; i++)
      {
          tripTimeMinutes.Add(i.ToString());
      }
  }
  
  public List&lt;string&gt; Hours
  {
      get
      {
          return tripTimeHours;
      }
  }
  
  public List&lt;string&gt; Minutes
  {
      get
      {
          return tripTimeMinutes;
      }
  }
  </code></pre>
  
  <p>What I want to be able to do is return the selected item from these combo boxes. I think I'm almost there, but just need to complete the final step.</p>