title: How to fire INotifyPropertyChanged handler when I change ComboBox's selected item?
body: <p>I'm trying to bind a <code>ComboBox</code> to an <code>ObservableCollection&lt;MyType&gt;</code> but it's not working as I expect. When I create an instance of <code>ComboData</code>, e.g.</p>
  
  <pre><code>ComboData = new ObservableCollection&lt;MyType&gt;();
  </code></pre>
  
  <p>and add data to it, e.g.</p>
  
  <pre><code>ComboData.Add(new MyType(string.Format("{0}", i.ToString()), i));
  </code></pre>
  
  <p>I can see that the <code>Value</code> property of <code>MyType</code> is being set and the <code>PropertyChangedEventHandler</code> event handler executes. This is correct functionality.</p>
  
  <p>The problem is when I select a different item in the <code>ComboBox</code> later. I expect to see <code>Value</code> being set again and firing the event handler, but nothing happens. However, I can see that the property's getter is being fired and returning <code>_value</code>.</p>
  
  <p>Is there something I'm doing wrong?</p>
  
  <p><code>MyType</code> is defined as:</p>
  
  <pre><code>public class MyType : INotifyPropertyChanged
  {
      public event PropertyChangedEventHandler PropertyChanged;
  
      public MyType(string key, int value)
      {
          Key = key;
          Value = value;
      }
  
      public string Key { get; set; }
      private int _value;
      public int Value
      {
          get { return _value; }
          set
          {
              if (_value != value)
              {
                  _value = value;
  
                  OnPropertyChanged("Value");
              }
          }
      }
  
      internal void OnPropertyChanged(string prop)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(prop));
          }
      }
  
      private void IntegerItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
      {
          // this never executes *after* the ComboBox has been populated!!!
      }
  
  }
  </code></pre>
  
  <p>The User Control's XAML is:</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;ComboBox x:Name="cboItems"
        DisplayMemberPath="Key"
        SelectedValuePath="Value"
        ItemsSource="{Binding Path=ComboData}"&gt;
      &lt;/ComboBox&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>And the code behind for the User Control is</p>
  
  <pre><code>public partial class ComboBoxControl : UserControl
  {
      public ObservableCollection&lt;MyType&gt; ComboData { get; set; }
  
      public ComboBoxControl()
      {
          InitializeComponent();
  
          ComboData = new ObservableCollection&lt;MyType&gt;();
          int min = 0;
          int max = 10;
          for (int i = min; i &lt;= max; i++)
          {
              ComboData.Add(new MyType(string.Format("{0}", i.ToString()), i));
          }
  
          cboItems.DataContext = this;            
      }
  }
  </code></pre>
  
  <p>What do I need to do to fire the event handler when I change the selected item in the <code>ComboBox</code>?</p>