title: WPF combobox binding and SelectedItem
body: <p>I have a list containing instances of the following class:</p>
  
  <pre><code>namespace Foo.InformationModel.Reference
  {
      public class ReferenceCodeTypeChar
      {
          public ReferenceCodeTypeChar();
  
          public string Category { get; set; }
          public string CodeValue { get; set; }
          public string Description { get; set; }
          public string Value { get; set; }
      }
  }
  </code></pre>
  
  <p>Here is the object that is used as the <code>DataContext</code> for the window in which the combobox is and its related properties:</p>
  
  <pre><code>public class MyObject
  {
      public List&lt;Foo.InformationModel.Reference.ReferenceCodeTypeChar&gt; ProgramTypes() {...}
  
      private string _selectedProgramTypeCode;
      public string SelectedProgramTypeCode
      {
          get
          {
              return _selectedProgramTypeCode;
          }
          set
          {
              if (_selectedProgramTypeCode != value)
              {
                  _selectedProgramTypeCode = value;
                  OnPropertyChanged("SelectedProgramTypeCode");
              }
          }
      }
  }
  </code></pre>
  
  <p>Here is the xaml code behind for the combobox:</p>
  
  <pre><code>&lt;ComboBox ItemsSource="{Binding Path=ProgramTypes}"
            SelectedItem="{Binding Path=SelectedProgramTypeCode, Mode=TwoWay}"
            DisplayMemberPath="Description"
            SelectedValuePath="Value"/&gt;
  </code></pre>
  
  <p>The problem happens inside SelectedProgramTypeCode. The value of the "value" variable is Foo.InformationModel.Reference.ReferenceCodeTypeChar instead of the expected string of Value property of the ReferenceCodeTypeChar object. What is wrong?</p>