title: WPF ComboBox databinding ItemsSource item.ToString() to property setter. Why?
body: <p>For some reason when I bind a ComboBox to a list of POCOs, the property which is bound to SelectedValue is set twice:</p>
  
  <ol>
  <li>With value = POCO.ToString()</li>
  <li>With value = POCO.Key property, <strong>which is the intended behaviour</strong></li>
  </ol>
  
  <p>I have the following ComboBox that is bound to properties in my ViewModel:</p>
  
  <pre><code>&lt;ComboBox ItemsSource="{Binding Path=AllowedClassifications}" 
            DisplayMemberPath="Value" 
            SelectedValue="{Binding Path=TargetGroup.Classification}" 
            SelectedValuePath="Key" /&gt;
  </code></pre>
  
  <p>The properties in ViewModel are defined as:</p>
  
  <pre><code>//ICollection is implemented by ObservableCollection&lt;T&gt;
  //DataBaseFieldValue has two public properties: string Key, string Value
  public ICollection&lt;DatabaseFieldValue&gt; AllowedClassifications
  {
      get { return _allowedClassifications; }
      private set { _allowedClassifications = value; }
  }
  
  public Model.TargetGroup TargetGroup
  {
      get { return _targetGroup; }
      private set { _targetGroup = value; OnPropertyChanged("TargetGroup"); }
  }   
  </code></pre>
  
  <p>TargetGroup.Classification is defined as:</p>
  
  <pre><code>public string Classification
  {
      get { return _classification; }
      set 
      {
          System.Diagnostics.Debug.WriteLine("Classification: " + value);
          _classification = value; 
          OnPropertyChanged("Classification"); 
      }
  }
  </code></pre>
  
  <p>Debug output:</p>
  
  <blockquote>
    <p>Classification:
    MyNamespace.DatabaseFieldValue</p>
    
    <p>Classification: 2</p>
  </blockquote>
  
  <p>What's happening here? Am I doing this completely wrong?</p>